login
a(n) = a(n-1) + a(m) for n >= 3, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1 and a(2) = 2.
12

%I #38 Nov 14 2019 10:43:28

%S 1,2,3,5,6,11,14,16,17,33,47,58,64,69,72,74,75,149,221,290,354,412,

%T 459,492,509,525,539,550,556,561,564,566,567,1133,1697,2258,2814,3364,

%U 3903,4428,4937,5429,5888,6300,6654,6944,7165,7314

%N a(n) = a(n-1) + a(m) for n >= 3, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1 and a(2) = 2.

%C 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

%C From _Petros Hadjicostas_, Nov 13 2019: (Start)

%C 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.

%C 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)

%H Ivan Neretin, <a href="/A050049/b050049.txt">Table of n, a(n) for n = 1..8193</a>

%e From _Petros Hadjicostas_, Nov 13 2019: (Start)

%e We explain _Amarnath Murthy_'s process (see the Comments above).

%e a(3) = a(2) + a(1) = 3. [Now a(3) is the last term available.]

%e a(4) = a(3) + a(2) = 5.

%e a(5) = a(3) + a(2) + a(1) = 6. [Now a(5) is the last term available.]

%e a(6) = a(5) + a(4) = 11.

%e a(7) = a(5) + a(4) + a(3) = 14.

%e a(8) = a(5) + a(4) + a(3) + a(2) = 16.

%e a(9) = a(5) + ... + a(1) = 17. [Now a(9) is the last term available.]

%e a(10) = a(9) + a(8) = 33.

%e a(11) = a(9) + a(8) + a(7) = 47.

%e ...

%e a(17) = a(9) + a(8) + ... + a(1) = 75. [Now a(17) is the last term available.]

%e a(18) = a(17) + a(16) = 149. (End)

%p a := proc(n) option remember;

%p `if`(n < 3, [1, 2][n], a(n - 1) + a(2^ceil(log[2](n - 1)) + 2 - n)); end proc;

%p seq(a(n), n = 1..50); # _Petros Hadjicostas_, Nov 13 2019

%t 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 *)

%Y Cf. A000051 (index of "available" terms as described above), A110428 (a multiplicative version of this sequence).

%Y Cf. similar sequences with different initial conditions: A050025 (1,1,1), A050029 (1,1,2), A050033 (1,1,3), A050037 (1,1,4), A050041 (1,2,1), A050045 (1,2,2), A050053 (1,2,4), A050057 (1,3,1), A050061 (1,3,2), A050065 (1,3,3), A050069 (1,3,4).

%K nonn

%O 1,2

%A _Clark Kimberling_

%E Name edited by _Petros Hadjicostas_, Nov 13 2019