login
A049970
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) = 2.
3
1, 3, 2, 7, 16, 30, 62, 123, 251, 496, 994, 1987, 3979, 7967, 15948, 31928, 63917, 127712, 255426, 510851, 1021707, 2043423, 4086860, 8173752, 16347565, 32695258, 65390761, 130782020, 261565033, 523132058, 1046268104, 2092544189
OFFSET
1,2
FORMULA
a(n) ~ c * 2^n, where c = 0.487208413167251561410300158795277398357249626073353318217181284278722123325... - Vaclav Kotesovec, Apr 26 2020
MATHEMATICA
a[1] = 1; a[2] = 3; a[3] = 2; a[n_] := a[n] = Sum[a[k], {k, 1, n - 1}] + a[n - 1 - 2^Floor[Log[2, n - 2]]]; Table[a[n], {n, 1, 32}] (* Vaclav Kotesovec, Apr 26 2020 *)
PROG
(PARI) lista(nn) = { my(va = vector(nn)); va[1] = 1; va[2] = 3; va[3] = 2; 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)
CROSSREFS
Cf. A049922 (similar, but with minus a(m)), A049923 (similar, but with minus a(2*m)), A049971 (similar, but with plus a(2*m)).
Sequence in context: A286940 A049968 A363399 * A344211 A104528 A177115
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Apr 25 2020
STATUS
approved