login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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

%I #21 May 15 2020 10:25:02

%S 1,1,4,5,6,7,8,12,17,18,19,23,28,34,41,49,61,62,63,67,72,78,85,93,105,

%T 122,140,159,182,210,244,285,334,335,336,340,345,351,358,366,378,395,

%U 413,432,455,483,517,558

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

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

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

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

%Y Cf. similar sequences with different initial conditions: A050026 (1,1,1), A050030 (1,1,2), A050034 (1,1,3), A050038 (1,1,4), A050042 (1,2,1), A050046 (1,2,2), A050054 (1,2,4), A050058 (1,3,1), A050062 (1,3,2), A050066 (1,3,3), A050070 (1,3,4).

%K nonn

%O 1,3

%A _Clark Kimberling_

%E Name edited by _Petros Hadjicostas_, May 15 2020