login

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 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A342448
Partial sums of A066194.
1
1, 3, 7, 10, 18, 25, 30, 36, 52, 67, 80, 94, 103, 113, 125, 136, 168, 199, 228, 258, 283, 309, 337, 364, 381, 399, 419, 438, 462, 485, 506, 528, 592, 655, 716, 778, 835, 893, 953, 1012, 1061, 1111, 1163, 1214, 1270, 1325, 1378, 1432, 1465, 1499, 1535, 1570
OFFSET
1,2
COMMENTS
n^2/2 + n/2 <= a(n) <= (31/50)*n^2 + n/2. The lower and upper bounds are attained at n=2^k and n=5*2^k for k >= 0.
LINKS
FORMULA
a(n) = A268836(n)/2 + n. - Kevin Ryde, Mar 12 2021
a(1) = 1; a(n) = [n == 0 (mod 2)]*(4*a(n/2) - n/2) + [n == 1 (mod 2)]*(2*a((n - 1)/2)+2*a((n + 1)/2)-(n-1)/2 - A010060(n)) where [] is an Iverson bracket
MAPLE
b:= proc(n) option remember; `if`(n<2, n,
Bits[Xor](n, b(iquo(n, 2))))
end:
a:= proc(n) a(n):= 1+`if`(n<2, 0, a(n-1)+b(n-1)) end:
seq(a(n), n=1..60); # Alois P. Heinz, Mar 14 2021
MATHEMATICA
a[1]=1;
a[n_/; EvenQ[n]]:= a[n] = 4a[n/2] - n/2;
a[n_/; OddQ[n]]:= a[n] = 2a[(n - 1)/2]+2a[(n + 1)/2]-(n-1)/2 - ThueMorse[n];
(* Second program: *)
b[n_] := If[n==0, 0, BitXor@@Table[Floor[n/2^m], {m, 0, Floor[Log[2, n]]}]];
A066194 = Table[b[n]+1, {n, 0, 60}];
A066194 // Accumulate (* Jean-François Alcover, Sep 10 2022 *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
John Erickson, Mar 12 2021
STATUS
approved