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!)
A049962 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) = 2, and a(3) = 4. 3

%I #23 May 06 2022 13:12:16

%S 1,2,4,8,17,33,67,136,276,545,1091,2184,4372,8753,17522,35078,70225,

%T 140315,280631,561264,1122532,2245073,4490162,8980358,17960785,

%U 35921710,71843689,143687924,287376941,574756070,1149516521,2299041811

%N 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) = 2, and a(3) = 4.

%p s := proc(n) option remember; `if`(n < 1, 0, a(n) + s(n - 1)); end proc;

%p a := proc(n) option remember; `if`(n < 4, [1, 2, 4][n], s(n - 1) + a(-2^ceil(log[2](n - 1) - 1) + n - 1)); end proc;

%p seq(a(n), n = 1 .. 40); # _Petros Hadjicostas_, Apr 23 2020

%o (PARI) lista(nn) = { my(va = vector(nn)); va[1] = 1; va[2] = 2; va[3] = 4; my(sa = vecsum(va)); for (n=4, nn, va[n] = sa + va[n - 1 - 2^ceil(-1 + log(n-1)/log(2))]; sa += va[n]; ); va; } \\ _Petros Hadjicostas_, Apr 26 2020 (with nn > 2).

%Y Cf. A049914 (similar, but with minus a(m)), A049915 (similar, but with minus a(2*m)), A049963 (similar, but with plus a(2*m)).

%K nonn

%O 1,2

%A _Clark Kimberling_

%E Name edited by _Petros Hadjicostas_, Apr 23 2020

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 August 28 06:46 EDT 2024. Contains 375477 sequences. (Running on oeis4.)