10-30-2015, 05:36 PM
For integer input N the programme returns the Nth element of the sequence
http://oeis.org/A000695
ie the binary base representation of N read as a quaternary base number.
http://oeis.org/A000695
ie the binary base representation of N read as a quaternary base number.
Code:
::
CK1&Dispatch
# FF
::
FPTR2 ^DupQIsZero?
?SEMI
Z0_
SWAP
FPTR2 ^Z>ZH
FPTR2 ^ZBits
ZERO_DO
SWAP
Z4_
FPTR2 ^RMULText
SWAP
ISTOP-INDEX
#1-
FPTR2 ^ZBit?
IT
::
SWAP
Z1_
FPTR2 ^RADDext
SWAP
;
LOOP
DROP
;
;