HP Forums

Full Version: (50g) OEIS A007931: Logic Binary Sequence
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For natural number input N the programme returns the Nth element of the sequence

https://oeis.org/A007931

Size: 102.5

CkSum: # 22764d

Code:
::
  CK1&Dispatch
  # FF
  ::
    DUP
    ZINT 1
    Z<
    caseSIZEERR
    NULL$SWAP
    ZINT 1
    FPTR2 ^RADDext
    BEGIN
    ZINT 2
    FPTR2 ^ZDIVext
    FPTR2 ^Z2BIN
    BINT49
    #+
    #>CHR
    ROTSWAP
    >H$
    SWAPDUP
    ZINT 0
    EQUAL
    UNTIL
    DROP
    CDR$
    FPTR2 ^S>Z
  ;
;
Reference URL's