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!)
A049945 a(n) = a(1) + a(2) + ... + a(n-1) + a(m) for n >= 4, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n-1 <= 2^(p+1), starting with a(1) = a(2) = 1 and a(3) = 4. 8
1, 1, 4, 7, 14, 34, 65, 127, 254, 634, 1206, 2381, 4742, 9477, 18951, 37899, 75798, 189494, 360040, 710606, 1416477, 2830593, 5660011, 11319450, 22638520, 45276913, 90553764, 181107497, 362214974, 724429941, 1448859879, 2897719755, 5795439510, 14488598774, 27528337672, 54332245406 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
From Petros Hadjicostas, Nov 06 2019: (Start)
a(n) = a(2^ceiling(log_2(n-1)) + 2 - n) + Sum_{i = 1..n-1} a(i) for n >= 4.
a(n) = a(n - 1 - A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 4. (End)
EXAMPLE
From Petros Hadjicostas, Nov 06 2019: (Start)
a(4) = a(2^ceiling(log_2(4-1)) + 2 - 4) + a(1) + a(2) + a(3) = a(2) + a(1) + a(2) + a(3) = 7.
a(5) = a(2^ceiling(log_2(5-1)) + 2 - 5) + a(1) + a(2) + a(3) + a(4) = a(1) + a(1) + a(2) + a(3) + a(4) = 14.
a(6) = a(2^ceiling(log_2(6-1)) + 2 - 6) + a(1) + a(2) + a(3) + a(4) + a(5) = a(4) + a(1) + a(2) + a(3) + a(4) + a(5) = 34.
a(7) = a(7 - 1 - A006257(7-2)) + Sum_{i = 1..6} a(i) = a(3) + Sum_{i = 1..6} a(i) = 65.
a(8) = a(8 - 1 - A006257(8-2)) + Sum_{i = 1..7} a(i) = a(2) + Sum_{i = 1..7} a(i) = 127. (End)
MAPLE
s:= proc(n) option remember; `if`(n<1, 0, a(n)+s(n-1)) end:
a:= proc(n) option remember; `if`(n<4, [1, 1, 4][n],
s(n-1)+a(Bits:-Iff(n-2$2)+3-n))
end:
seq(a(n), n=1..36); # Petros Hadjicostas, Nov 06 2019
CROSSREFS
Sequence in context: A050343 A245002 A199628 * A234576 A076586 A240266
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name edited by and more terms from Petros Hadjicostas, Nov 06 2019
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 April 19 18:05 EDT 2024. Contains 371798 sequences. (Running on oeis4.)