HP Forums

Full Version: (49G) Number of Characters in Roman representation (OEIS A006968)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For integer input N the programme returns the number of letters required for the Roman representation of N, in accord with

http://oeis.org/A006968

Code:

::
  CK1&Dispatch
  BINT1
  ::
    COERCE
    BINT0
    BINT3
    ZERO_DO
    SWAP
    BINT10
    #/
    3UNROLL
    ::
      BINT4
      OVER#>
      ?SEMI
      BINT5
      #=casedrop
      BINT1
      BINT7
      #=casedrop
      BINT3
      BINT8
      #=case
      BINT4
      BINT2
    ;
    #+
    LOOP
    #+
    FPTR2 ^#>Z
  ;
;
Reference URL's