login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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)).
Sequence in context: A024934 A186358 A170839 * A357182 A028861 A081521
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name edited by Petros Hadjicostas, Apr 26 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 12:26 EDT 2024. Contains 371254 sequences. (Running on oeis4.)