OFFSET
1,2
COMMENTS
a(1) = 1 and a(2) = 2; subsequent terms are generated like this: if a(s) is the last term available, say a(2), then a(s+1) = a(s) + a(s-1), a(s+2) = a(s) + a(s-1) + a(s-2), ..., a(2*s-1) = a(s) + a(s-1) + a(s-2) + ... + a(2) + a(1), a(2*s) = a(2*s-1) + a(2*s-2), and so on. - Amarnath Murthy, Aug 01 2005
From Petros Hadjicostas, Nov 13 2019: (Start)
We explain further the process introduced by Amarnath Murthy above. The terms a(s) that are the "last term[s] available" are those that correspond to s = A000051(k) = 2^k + 1 for k >= 0. Thus, they are the terms a(2), a(3), a(5), a(9), a(17), a(33), and so on. See the example below.
In the Mathematica program below, the author of the program starts with a(1) = 1, a(2) = 2, and a(3) = 3, but that is not necessary. We may start with a(1) = 1 and a(2) = 2 and still get the same sequence. (End)
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..8193
EXAMPLE
From Petros Hadjicostas, Nov 13 2019: (Start)
We explain Amarnath Murthy's process (see the Comments above).
a(3) = a(2) + a(1) = 3. [Now a(3) is the last term available.]
a(4) = a(3) + a(2) = 5.
a(5) = a(3) + a(2) + a(1) = 6. [Now a(5) is the last term available.]
a(6) = a(5) + a(4) = 11.
a(7) = a(5) + a(4) + a(3) = 14.
a(8) = a(5) + a(4) + a(3) + a(2) = 16.
a(9) = a(5) + ... + a(1) = 17. [Now a(9) is the last term available.]
a(10) = a(9) + a(8) = 33.
a(11) = a(9) + a(8) + a(7) = 47.
...
a(17) = a(9) + a(8) + ... + a(1) = 75. [Now a(17) is the last term available.]
a(18) = a(17) + a(16) = 149. (End)
MAPLE
a := proc(n) option remember;
`if`(n < 3, [1, 2][n], a(n - 1) + a(2^ceil(log[2](n - 1)) + 2 - n)); end proc;
seq(a(n), n = 1..50); # Petros Hadjicostas, Nov 13 2019
MATHEMATICA
Fold[Append[#1, #1[[-1]] + #1[[#2]]] &, {1, 2, 3}, Flatten@Table[k, {n, 5}, {k, 2^n, 1, -1}]] (* Ivan Neretin, Sep 07 2015 *)
CROSSREFS
Cf. A000051 (index of "available" terms as described above), A110428 (a multiplicative version of this sequence).
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name edited by Petros Hadjicostas, Nov 13 2019
STATUS
approved