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!)
A049978 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), with a(1) = 1, a(2) = 3, and a(3) = 4. 1
1, 3, 4, 9, 20, 38, 78, 157, 319, 630, 1262, 2525, 5055, 10121, 20260, 40560, 81199, 162242, 324486, 648973, 1297951, 2595913, 5191844, 10383728, 20767535, 41535232, 83070775, 166142182, 332285627, 664573784, 1329152634, 2658315407, 5316651114, 10633261669, 21266523340, 42533046681, 85066093367, 170132186745 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = a(n - 1 - 2^ceiling(-1 + log_2(n-1))) + Sum_{i = 1..n-1} a(i) = a((1 + A006257(n-2))/2) + Sum_{i = 1..n-1} a(i) for n >= 4 with a(1) = 1, a(2) = 3, and a(3) = 4. - Petros Hadjicostas, Sep 27 2019
EXAMPLE
From Petros Hadjicostas, Sep 27 2019: (Start)
a(4) = a(4-1-2^ceiling(-1 + log_2(4-1))) + a(1) + a(2) + a(3) = a(1) + a(1) + a(2) + a(3) = 9.
a(5) = a(5-1-2^ceiling(-1 + log_2(5-1))) + a(1) + a(2) + a(3) + a(4) = a(2) + a(1) + a(2) + a(3) + a(4) = 20.
a(6) = a(6-1-2^ceiling(-1 + log_2(6-1))) + a(1) + a(2) + a(3) + a(4) + a(5) = a(1) + a(1) + a(2) + a(3) + a(4) + a(5) = 38.
(End)
MAPLE
a := proc(n) local i; option remember; if n < 4 then return [1, 3, 4][n]; end if; add(a(i), i = 1 .. n - 1) + a(n - 3/2 - 1/2*Bits:-Iff(n - 2, n - 2)); end proc;
seq(a(n), n = 1 .. 37); # Petros Hadjicostas, Sep 27 2019 using a modification of a program by Peter Luschny
CROSSREFS
Sequence in context: A110810 A247579 A282615 * A324764 A092763 A232955
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name edited by and more terms from Petros Hadjicostas, Sep 27 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 24 08:43 EDT 2024. Contains 371927 sequences. (Running on oeis4.)