login
A049966
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) = 3, and a(3) = 1.
3
1, 3, 1, 6, 14, 26, 54, 106, 217, 429, 860, 1718, 3441, 6890, 13792, 27612, 55276, 110447, 220896, 441790, 883585, 1767178, 3534368, 7068764, 14137580, 28275271, 56550754, 113101939, 226204736, 452411195, 904825839, 1809658580
OFFSET
1,2
PROG
(PARI) lista(nn) = { nn = max(nn, 3); my(va = vector(nn)); va[1] = 1; va[2] = 3; va[3] = 1; 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. A049918 (similar, but with minus a(m)), A049919 (similar, but with minus a(2*m)), A049967 (similar, but with plus a(2*m)).
Sequence in context: A143984 A051124 A193091 * A187120 A350610 A140982
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Apr 24 2020
STATUS
approved