login
a(n) = a(1) + a(2) + ... + 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) = 1, a(2) = 2 and a(3) = 4.
3

%I #21 May 06 2022 13:12:15

%S 1,2,4,6,11,23,45,88,174,353,705,1408,2814,5623,11234,22446,44849,

%T 89785,179569,359136,718270,1436535,2873058,5746094,11492145,22984204,

%U 45968229,91936106,183871509,367741612,735480415,1470955219

%N a(n) = a(1) + a(2) + ... + 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) = 1, a(2) = 2 and a(3) = 4.

%o (PARI) lista(nn) = { my(va = vector(nn)); va[1] = 1; va[2] = 2; va[3] = 4; my(sa = vecsum(va)); for (n=4, nn, va[n] = sa - va[n - 1 - 2^ceil(-1 + log(n-1)/log(2))]; sa += va[n]; ); va; } \\ _Petros Hadjicostas_, Apr 26 2020 (with nn > 2).

%Y Cf. A049915 (similar, but with minus a(2*m)), A049962 (similar, but with plus a(m)), A049963 (similar, but with plus a(2*m)).

%K nonn

%O 1,2

%A _Clark Kimberling_

%E Name edited by _Petros Hadjicostas_, Apr 26 2020