OFFSET
1,3
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
G.f.: Sum_{k>=1} x^k * (1 + 3 * x^(2*k) + x^(3*k) + 3 * x^(4*k) + x^(6*k)) / (1 - x^(4*k))^2.
a(n) = Sum_{d|n, n/d odd} d - Sum_{d|n, n/d twice odd} d.
From Amiram Eldar, Dec 05 2022: (Start)
Multiplicative with a(2^e) = 2^(e-1), and a(p^e) = (p^(e+1)-1)/(p-1) if p > 2.
Sum_{k=1..n} a(k) ~ c * n^2, where c = 3*Pi^2/64 = 0.462637... . (End)
Dirichlet g.f.: zeta(s)*zeta(s-1)*(1-1/2^s)^2. - Amiram Eldar, Jan 06 2023
MAPLE
N:= 100:
G:= add(k * x^k * (1 - x^k + x^(2*k)) / (1 - x^(4*k)), k=1..N):
S:= series(G, x, N+1):
[seq(coeff(S, x, i), i=1..N)]; # Robert Israel, Sep 17 2019
MATHEMATICA
nmax = 66; CoefficientList[Series[Sum[k x^k (1 - x^k + x^(2 k))/(1 - x^(4 k)), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
A002131[n_] := Total[Select[Divisors[n], OddQ[n/#] &]]; a[n_] := If[OddQ[n], A002131[n], A002131[n] - A002131[n/2]]; Table[a[n], {n, 1, 66}]
f[p_, e_] := (p^(e + 1) - 1)/(p - 1); f[2, e_] := 2^(e - 1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Dec 05 2022 *)
PROG
(PARI) a(n)={sumdiv(n, d, d*((n/d%2==1) - (n/d%4==2)))} \\ Andrew Howroyd, Sep 13 2019
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Ilya Gutkovskiy, Sep 13 2019
STATUS
approved