login
A049907
a(n) = a(1) + a(2) + ... + a(n-1) - a(m) for n >= 4, where m = 2*n - 2 - 2^(p+1) and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1 and a(2) = a(3) = 2.
3
1, 2, 2, 3, 5, 11, 21, 34, 45, 122, 243, 478, 933, 1778, 3200, 5100, 6878, 18854, 37707, 75406, 150789, 301490, 602624, 1203948, 2404574, 4795394, 9534236, 18842388, 36782318, 69973190, 125899386, 200667970, 270641160, 741950288
OFFSET
1,2
PROG
(PARI) lista(nn) = { nn = max(nn, 3); my(va = vector(nn)); va[1] = 1; va[2] = 2; va[3] = 2; my(sa = vecsum(va)); for (n=4, nn, va[n] = sa - va[2*(n - 1 - 2^logint(n-2, 2))]; sa += va[n]; ); va; } \\ Petros Hadjicostas, May 03 2020
CROSSREFS
Cf. A049906 (similar, but with minus a(m/2)), A049954 (similar, but with plus a(m/2)), A049955 (similar, but with plus a(m)).
Sequence in context: A080008 A058697 A030427 * A078445 A127166 A103596
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, May 03 2020
STATUS
approved