|
|
A049918
|
|
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, 4, 6, 14, 26, 54, 105, 213, 424, 850, 1697, 3392, 6776, 13540, 27052, 54157, 108312, 216626, 433249, 866496, 1732984, 3465956, 6931884, 13863717, 27727326, 55454441, 110908456, 221816065, 443630435, 887257486, 1774508208
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
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. A049919 (similar, but with minus a(2*m)), A049966 (similar, but with plus a(m)), A049967 (similar, but with plus a(2*m)).
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|