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

%I #14 Jul 20 2020 02:16:52

%S 1,2,4,6,12,14,20,34,68,70,76,90,124,194,284,478,956,958,964,978,1012,

%T 1082,1172,1366,1844,2802,3780,4862,6228,9030,13892,22922,45844,45846,

%U 45852,45866,45900,45970,46060,46254,46732

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

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

%t Fold[Append[#1, #1[[-1]] + #1[[#2]]] &, {1, 2, 4}, Flatten@Table[2 k, {n, 5}, {k, 2^n}]] (* _Ivan Neretin_, Sep 07 2015 *)

%o (PARI) lista(nn) = {nn = max(nn, 3); my(va = vector(nn)); va[1] = 1; va[2] = 2; va[3] = 4; for(n=4, nn, va[n] = va[n-1] + va[2*(n - 1 - 2^logint(n-2, 2))]); va;} \\ _Petros Hadjicostas_, Jul 19 2020

%Y Cf. A050027, A050031, A050035, A050039, A050043, A050047, A050051, A050059, A050063, A050067, A050071 (similar, but with different initial conditions).

%K nonn

%O 1,2

%A _Clark Kimberling_

%E Name edited by _Petros Hadjicostas_, Jul 19 2020