HP 49G: OEIS A004001 - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: HP 49G: OEIS A004001 (/thread-3292.html) |
HP 49G: OEIS A004001 - Gerald H - 03-07-2015 10:03 AM 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 ; ; |