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!)
A049943 a(n) = a(1) + a(2) + ... + a(n-1) + a(m) for n >= 3, where m = 2*n - 2 - 2^(p+1) and p is the unique integer such that 2^p < n-1 <= 2^(p+1), starting with a(1) = a(2) = 1. 4
1, 1, 3, 6, 17, 29, 63, 149, 418, 688, 1381, 2785, 5690, 11919, 25935, 61004, 171093, 281183, 562371, 1124765, 2249650, 4499839, 9001775, 18012684, 36074453, 72369085, 145581752, 294538578, 602590001, 1259536403, 2741242299, 6447482423, 18082910866, 29718339310 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
From Petros Hadjicostas, Oct 26 2019: (Start)
a(n) = a(2*n - 2 - 2^ceiling(log_2(n-1))) + Sum_{i = 1..n-1} a(i) for n >= 3.
a(n) = a(1 + A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 3.
(End)
EXAMPLE
From Petros Hadjicostas, Oct 26 2019: (Start)
a(3) = a(1 + A006257(3-2)) + a(1) + a(2) = a(2) + a(1) + a(2) = 3;
a(4) = a(1 + A006257(4-2)) + a(1) + a(2) + a(3) = a(2) + a(1) + a(2) + a(3) = 6;
a(5) = a(1 + A006257(5-2)) + a(1) + a(2) + a(3) + a(4) = a(4) + a(1) + a(2) + a(3) + a(4) = 17. (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 < 3, 1, s(n - 1) + a(2*n - 3 - Bits:-Iff(n - 2, n - 2)));
end proc:
seq(a(n), n = 1 .. 50); # Petros Hadjicostas, Oct 26 2019
MATHEMATICA
A006257[n_] := Boole[BitXor[n, #] < n]& /@ Range[n] // Total;
a[n_] := a[n] = If[n < 3, 1, a[1 + A006257[n-2]] + Total@Array[a, n-1]];
Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Apr 24 2022 *)
CROSSREFS
Cf. A006257, A049894 (similar, but with minus a(m/2), A049895 (similar, but with minus a(m)), A049942 (similar, but with plus a(m/2)).
Sequence in context: A369707 A327068 A307604 * A231184 A291227 A027415
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Petros Hadjicostas, Oct 26 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 March 28 17:25 EDT 2024. Contains 371254 sequences. (Running on oeis4.)