|
|
A137843
|
|
Define S(1) = {1}, S(n+1) = S(n) U S(n) if a(n) is even, S(n+1) = S(n) U (n+1) U S(n) if a(n) is odd. Sequence {a(n), n >= 1} is limit as n approaches infinity of S(n). (U represents concatenation.).
|
|
4
|
|
|
1, 2, 1, 1, 2, 1, 4, 1, 2, 1, 1, 2, 1, 5, 1, 2, 1, 1, 2, 1, 4, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 4, 1, 2, 1, 1, 2, 1, 5, 1, 2, 1, 1, 2, 1, 4, 1, 2, 1, 1, 2, 1, 7, 1, 2, 1, 1, 2, 1, 4, 1, 2, 1, 1, 2, 1, 5, 1, 2, 1, 1, 2, 1, 4, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 4, 1, 2, 1, 1, 2, 1, 5, 1, 2, 1, 1, 2, 1, 4, 1, 2, 1, 1, 2, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
EXAMPLE
|
S(1) = {1}.
S(2) = {1,2,1}, because a(1) = 1, which is odd.
S(3) = {1,2,1,1,2,1}, because a(2) = 2, which is even.
S(4) = {1,2,1,1,2,1,4,1,2,1,1,2,1}, as a(3) is odd.
S(5) = {1,2,1,1,2,1,4,1,2,1,1,2,1,5,1,2,1,1,2,1,4,1,2,1,1,2,1}, as a(4) is odd.
Etc.
|
|
PROG
|
(Scheme, with memoization-macro definec)
|
|
CROSSREFS
|
Cf. A291753 (the length of stage n).
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|