Post Reply 
HP 49G: OEIS A004001
03-07-2015, 10:03 AM
Post: #1
HP 49G: OEIS A004001
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
;
;
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)