|
|
A174868
|
|
Partial sums of Stern's diatomic series A002487.
|
|
4
|
|
|
0, 1, 2, 4, 5, 8, 10, 13, 14, 18, 21, 26, 28, 33, 36, 40, 41, 46, 50, 57, 60, 68, 73, 80, 82, 89, 94, 102, 105, 112, 116, 121, 122, 128, 133, 142, 146, 157, 164, 174, 177, 188, 196, 209, 214, 226, 233, 242, 244, 253, 260, 272, 277, 290, 298, 309, 312, 322, 329, 340, 344, 353, 358, 364, 365, 372, 378, 389, 394, 408, 417, 430, 434, 449, 460, 478, 485, 502, 512, 525, 528, 542, 553, 572, 580, 601, 614, 632, 637, 654, 666, 685
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
After the initial 0, identical to A007729.
|
|
LINKS
|
|
|
FORMULA
|
G.f.: (x/(1 - x))*Product_{k>=0} (1 + x^(2^k) + x^(2^(k+1))). - Ilya Gutkovskiy, Feb 27 2017
a(n) = n^log_2(3) + Psi_D(log_2(n)) + O(n^log_2(phi)), where phi is the golden ratio (A001622) and Psi_D is a 1-periodic continuous function which is Hölder continuous with any exponent smaller than log_2(3/phi) (Heuberger et al., 2022). - Amiram Eldar, May 18 2023
|
|
EXAMPLE
|
a(16) = 0 + 1 + 1 + 2 + 1 + 3 + 2 + 3 + 1 + 4 + 3 + 5 + 2 + 5 + 3 + 4 + 1 = 41.
|
|
MATHEMATICA
|
a[n_] := a[n] = If[EvenQ[n], 2*a[n/2] + a[n/2 - 1], 2*a[(n - 1)/2] + a[(n + 1)/2]]; a[0] = 0; a[1] = 1; Array[a, 100, 0] (* Amiram Eldar, May 18 2023 *)
|
|
PROG
|
(Python)
from itertools import accumulate, count, islice
from functools import reduce
def A174868_gen(): # generator of terms
return accumulate((sum(reduce(lambda x, y:(x[0], x[0]+x[1]) if int(y) else (x[0]+x[1], x[1]), bin(n)[-1:2:-1], (1, 0))) for n in count(1)), initial=0)
|
|
CROSSREFS
|
Cf. A002487, A007729, A084091, A049456, A020946, A020950, A046815, A070871, A070872, A071883, A064881-A064886, A072170, A001045, A002083, A073459, A000123, A126606, A049455.
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|