OFFSET
1,3
FORMULA
G.f.: Sum_{k>=0} x^(2^k) / (1 + x^(2^k))^2.
G.f.: Sum_{k>=1} (-1)^(k + 1) * phi(2*k) * x^k / (1 - x^k), where phi = A000010.
a(2*n) = a(n) - 2*n, a(2*n+1) = 2*n + 1.
From Werner Schulte, Oct 05 2020: (Start)
Multiplicative with a(2^e) = 3 - 2^(e+1) and a(p^e) = p^e for e >= 0 and prime p > 2.
Dirichlet g. f.: Sum_{n>0} a(n)/n^s = zeta(s-1) * (1-3/(2^s-1)). (End)
MATHEMATICA
nmax = 65; CoefficientList[Series[Sum[x^(2^k)/(1 + x^(2^k))^2, {k, 0, Floor[Log[2, nmax]] + 1}], {x, 0, nmax}], x] // Rest
nmax = 65; CoefficientList[Series[Sum[(-1)^(k + 1) EulerPhi[2 k] x^k/(1 - x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
a[n_] := If[EvenQ[n], a[n/2] - n, n]; Table[a[n], {n, 1, 65}]
PROG
(Magma) a:=[1]; for k in [1..65] do if IsOdd(k) then a[k]:=k; else a[k]:=a[k div 2]-k; end if; end for; a; // Marius A. Burtea, Oct 07 2019
(PARI) a(n) = if (n==1, 1, if (n % 2, n, a(n/2) - n)); \\ Michel Marcus, Oct 07 2019
(PARI) a(n) = 3*(n>>valuation(n, 2)) - n<<1; \\ Kevin Ryde, Oct 06 2020
CROSSREFS
KEYWORD
sign,mult
AUTHOR
Ilya Gutkovskiy, Oct 05 2019
STATUS
approved