HP Forums

Full Version: (49G) OEIS A006046 (Partial Sums of Gould's Sequence)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
  ;
;
Reference URL's