HP Forums

Full Version: HP 49G: OEIS A004001
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
An HP 49G prog to reproduce this sequence for positive integer input:

http://oeis.org/search?q=a004001&languag...&go=Search

The first 100 elements of the sequence are found in < 4sec.

::
CK1&Dispatch
BINT1
::
COERCE
DUP#0=
caseSIZEERR
{
Z1_
}
SWAP
DUP#1=
caseDROP
DUP
#2=
casedrop
::
Z1_
>HCOMP
;
SWAPDROP
DUP1LAMBIND
{
BINT1
BINT1
}
SWP1+
BINT3
DO
DUPDUP
INDEX@
#1-
NTHCOMPDROP
2DUP
INDEX@
SWAP#-
NTHCOMPDROP
3UNROLL
NTHCOMPDROP
#+
>TCOMP
LOOP
INNERCOMP
ZERO_DO
FPTR2 ^#>Z
1GETLAM
ROLL
LOOP
1GETABND
{}N
;
;
Reference URL's