HP Forums
(49G) OEIS A006046 (Partial Sums of Gould's Sequence) - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (49G) OEIS A006046 (Partial Sums of Gould's Sequence) (/thread-4628.html)



(49G) OEIS A006046 (Partial Sums of Gould's Sequence) - Gerald H - 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).

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
  ;
;