OFFSET
1,3
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
G.f.: Sum_{k>=0} (-1)^k * x^(2^k) / (1 - x^(2^k))^2.
G.f. A(x) satisfies: A(x) = x / (1 - x)^2 - A(x^2).
Dirichlet g.f.: zeta(s-1) / (1 + 2^(-s)).
a(n) = Sum_{d|n} A154269(n/d) * d.
Sum_{k=1..n} a(k) ~ 2*n^2/5. - Vaclav Kotesovec, Jun 11 2020
Multiplicative with a(2^e) = A001045(e+1) and a(p^e) = p^e for e >= 0 and prime p > 2. - Werner Schulte, Oct 05 2020
MATHEMATICA
a[n_] := a[n] = If[EvenQ[n], n - a[n/2], n]; Table[a[n], {n, 1, 75}]
nmax = 75; CoefficientList[Series[Sum[(-1)^k x^(2^k)/(1 - x^(2^k))^2, {k, 0, Floor[Log[2, nmax]]}], {x, 0, nmax}], x] // Rest
f[p_, e_] := If[p == 2, (2^(e + 1) + (-1)^e)/3, p^e]; a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Dec 02 2020 *)
PROG
(PARI) a(n) = my(k=valuation(n, 2)); (n<<1 + (n>>k)*(-1)^k)/3; \\ Kevin Ryde, Oct 06 2020
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Ilya Gutkovskiy, May 23 2020
STATUS
approved