HP Forums
(50g) OEIS A007931: Logic Binary Sequence - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (50g) OEIS A007931: Logic Binary Sequence (/thread-9081.html)



(50g) OEIS A007931: Logic Binary Sequence - Gerald H - 09-15-2017 05:46 AM

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
  ;
;