login
A049894
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) = a(2) = 1 and a(3) = 3.
3
1, 1, 3, 4, 8, 16, 32, 62, 123, 249, 498, 994, 1987, 3970, 7932, 15848, 31666, 63393, 126786, 253570, 507139, 1014274, 2028540, 4057064, 8114098, 16228135, 32456144, 64912039, 129823582, 259646171, 519290359, 1038576756, 2077145596
OFFSET
1,3
PROG
(PARI) lista(nn) = { nn = max(nn, 3); my(va = vector(nn)); va[1] = 1; va[2] = 1; va[3] = 3; my(sa = vecsum(va)); for (n=4, nn, va[n] = sa - va[n - 1 - 2^logint(n-2, 2)]; sa += va[n]; ); va; } \\ Petros Hadjicostas, May 03 2020
CROSSREFS
Cf. A049895 (similar, but with minus a(2*m)), A049942 (similar, but with plus a(m)), A049943 (similar, but with plus a(2*m)).
Sequence in context: A293781 A202025 A227615 * A198633 A153057 A215095
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, May 03 2020
STATUS
approved