OFFSET
0,3
COMMENTS
After the initial 0, identical to A007729.
LINKS
Amiram Eldar, Table of n, a(n) for n = 0..10000
Michael J. Collins and David Wilson, Equivalence of OEIS A007729 and A174868, arXiv:1812.11174 [math.CO], 2018.
Clemens Heuberger, Daniel Krenn and Gabriel F. Lipnik, Asymptotic Analysis of q-Recursive Sequences, Algorithmica, Vol. 84 (2022), pp. 2480-2532; arXiv preprint, arXiv:2105.04334 [math.CO], 2021-2022.
FORMULA
a(n) = Sum_{i=0..n} A002487(i).
G.f.: (x/(1 - x))*Product_{k>=0} (1 + x^(2^k) + x^(2^(k+1))). - Ilya Gutkovskiy, Feb 27 2017
a(2k) = 2*a(k) + a(k-1); a(2k+1) = 2*a(k) + a(k+1). - Michael J. Collins, Dec 25 2018
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
KEYWORD
nonn,easy
AUTHOR
Jonathan Vos Post, Dec 01 2010
STATUS
approved