09-02-2015, 03:46 PM
For positive integer N entry the programme below reproduces the Nth element of
http://oeis.org/A006046
ie the partial sums of Gould's sequence (http://oeis.org/A001316).
http://oeis.org/A006046
ie the partial sums of Gould's sequence (http://oeis.org/A001316).
Code:
::
CK1&Dispatch
# FF
::
'
::
DUP
Z2_
Z<
?SEMI
Z2_
FPTR2 ^ZDIVext
Z0_
EQUALcase
::
1GETLAM
EVAL
Z3_
FPTR2 ^RMULText
;
DUP
1GETLAM
EVAL
DUP
FPTR2 ^RADDext
SWAP
Z1_
FPTR2 ^RADDext
1GETLAM
EVAL
FPTR2 ^RADDext
;
DUP1LAMBIND
EVAL
ABND
;
;