02-17-2018, 09:10 PM
For binary integer input B the programme returns B's position in the sequence
https://oeis.org/A057148
eg For input
1000101010101010001
the programme returns
1066.
Size: 158.5
CkSum: # EC76h
https://oeis.org/A057148
eg For input
1000101010101010001
the programme returns
1066.
Size: 158.5
CkSum: # EC76h
Code:
::
CK1&Dispatch
# FF
::
DUP
ZINT 2
Z<
case
::
ZINT 1
FPTR2 ^QAdd
;
FPTR2 ^Z>S
DUPLEN$
BINT2
#/
SWAP
#0=ITE
::
ONESWAP
SUB$
"1"
;
::
#1+
ONESWAP
SUB$
CDR$
"10"
;
SWAP&$
ZINT 0
OVERLEN$
#1+_ONE_DO
DUP
FPTR2 ^QAdd
OVERINDEX@
SUB$1#
BINT48
#=ITE
ZINT 0
ZINT 1
FPTR2 ^QAdd
LOOP
SWAPDROP
;
;