Post Reply 
(33s) OEIS A2516: EARLIEST SEQUENCE WITH A(A(N)) = 2N
08-25-2022, 10:13 AM (This post was last modified: 08-29-2022 04:44 PM by Gerald H.)
Post: #12
RE: (33s): OEIS A2516 EARLIEST SEQUENCE WITH A(A(N)) = 2N
Inspired by Ret's etc programme here's my own attempt at derecursivising.

NB Preserves the stack.

Code:
1.    LBL S
2.    x=0?
3.    RTN
4.    STO N
5.    RCL/N
6.    STO C
1.    LBL T
2.    CLx
3.    RMDR(N:2)
4.    x≠0?
5.    GTO U
6.    CLx
7.    2
8.    STO* C
9.    CLx
10.    N/2
11.    STO N
12.    GTO T
1.    LBL U
2.    CLx
3.    C*(N+2+(N-6)*RMDR(IDIV(N:2):2))
4.    RTN

S: LN = 18
T: LN = 60
U: LN = 43
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (33s): OEIS A2516 EARLIEST SEQUENCE WITH A(A(N)) = 2N - Gerald H - 08-25-2022 10:13 AM



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