The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
(33s) OEIS A2516: EARLIEST SEQUENCE WITH A(A(N)) = 2N
07-29-2022, 04:40 PM (This post was last modified: 08-27-2022 10:31 AM by Gerald H.)
Post: #1
(33s) OEIS A2516: EARLIEST SEQUENCE WITH A(A(N)) = 2N
Takes a real integer from the stack & returns A2516(N) to stack.

https://oeis.org/A002516

Maximum number of recursions is 7, ie any number with a power of 2 greater than 2^7 as a factor will produce the
“XEQ OVERFLOW”
error.

Earliest sequence with
A(A(N)) = 2N.


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

C: LN = 62
E: LN = 19
D: LN = 24
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(33s) OEIS A2516: EARLIEST SEQUENCE WITH A(A(N)) = 2N - Gerald H - 07-29-2022 04:40 PM



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