login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A049885 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) = a(3) = 1. 4
1, 1, 1, 2, 4, 7, 15, 30, 60, 91, 197, 402, 807, 1616, 3233, 6466, 12932, 19399, 42031, 85679, 172167, 344739, 689683, 1379472, 2758975, 5517980, 11035975, 22071958, 44143919, 88287840, 176575681, 353151362, 706302724, 1059454087 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

LINKS

Table of n, a(n) for n=1..34.

FORMULA

From Petros Hadjicostas, Nov 07 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 07 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) = 2.

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) = 4.

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) = 7.

a(7) =  -a(7 - 1 - A006257(7-2)) + Sum_{i = 1..6} a(i) = -a(3) +  Sum_{i = 1..6} a(i) = 15.

a(8) =  -a(8 - 1 - A006257(8-2)) + Sum_{i = 1..7} a(i) = -a(2) +  Sum_{i = 1..7} a(i) = 30. (End)

MAPLE

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

a := proc(n) option remember;

`if`(n < 4, 1, s(n - 1) - a(Bits:-Iff(n - 2, n - 2) + 3 - n)):

end proc:

seq(a(n), n = 1..34); # Petros Hadjicostas, Nov 07 2019

PROG

(PARI) lista(nn) = { my(va = vector(nn)); va[1] = 1; va[2] = 1; va[3] = 1; my(sa = vecsum(va)); for (n=4, nn, va[n] = sa - va[2 - n + 2^ceil(log(n-1)/log(2))]; sa += va[n]; ); va; } \\ Petros Hadjicostas, Apr 27 2020 (with nn > 2)

CROSSREFS

Cf. A006257, A049933 (similar with plus a(m)).

Sequence in context: A232394 A115178 A331934 * A129682 A129981 A072964

Adjacent sequences:  A049882 A049883 A049884 * A049886 A049887 A049888

KEYWORD

nonn

AUTHOR

Clark Kimberling

EXTENSIONS

Name edited by Petros Hadjicostas, Nov 07 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 2 08:31 EST 2021. Contains 349437 sequences. (Running on oeis4.)