(49G) OEIS A2516: EARLIEST SEQUENCE WITH A(A(N)) = 2N

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (49G) OEIS A2516: EARLIEST SEQUENCE WITH A(A(N)) = 2N (/thread-18714.html)



(49G) OEIS A2516: EARLIEST SEQUENCE WITH A(A(N)) = 2N - Gerald H - 08-25-2022 06:54 AM

Takes a real integer from the stack & returns A2516(N) to stack.

https://oeis.org/A002516


Code:
Size: 120.

CkSum: # 4226h

::
  CK1&Dispatch
  # FF
  ::
    FPTR2 ^DupQIsZero?
    ?SEMI
    FPTR2 ^ZTrialDiv2
    SWAPDUP
    ZINT 2
    FPTR2 ^RADDext
    OVER
    ZINT 6
    FPTR2 ^RSUBext
    ROT
    ZINT 2
    FPTR2 ^ZQUOText
    ZINT 2
    FPTR2 ^ZMod
    FPTR2 ^RMULText
    FPTR2 ^RADDext
    ZINT 2
    ROT
    FPTR2 ^RP#
    FPTR2 ^RMULText
  ;
;