OFFSET
1,2
LINKS
Paul D. Hanna, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = (-1)^n * Sum_{d|n^2} (-1)^d * d.
a(n) = A113184(n^2).
a(n) = sigma(n^2) for odd n; a(n) = 4*sigma(n^2/2) - sigma(n^2) for even n. - Andrew Howroyd, Jul 28 2018
Multiplicative with a(p^e) = 2^(2*e+1)-3 if p=2, and (p^(2*e+1)-1)/(p-1) otherwise. - Amiram Eldar, Jul 01 2022
Sum_{k=1..n} a(k) ~ c * n^3, where c = (9*zeta(3))/(2*Pi^2) = 0.548072... . - Amiram Eldar, Oct 13 2022
EXAMPLE
L.g.f.: L(x) = x + 5*x^2/2 + 13*x^3/3 + 29*x^4/4 + 31*x^5/5 + 65*x^6/6 + 57*x^7/7 + 125*x^8/8 + 121*x^9/9 + 155*x^10/10 +...
where
exp(L(x)) = 1 + x + 3*x^2 + 7*x^3 + 16*x^4 + 30*x^5 + 64*x^6 + 120*x^7 + 236*x^8 + 434*x^9 + 805*x^10 +...+ A224340(n)*x^n +...
MATHEMATICA
dif[n_]:=Module[{divs=Divisors[n^2], od, ev}, od=Total[Select[divs, OddQ]]; ev=Total[Select[divs, EvenQ]]; Abs[od-ev]]; Array[dif, 60] (* Harvey P. Dale, Jul 16 2015 *)
f[p_, e_] := If[p == 2, 2^(2*e + 1) - 3, (p^(2*e + 1) - 1)/(p - 1)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jul 01 2022 *)
PROG
(PARI) {a(n)=if(n<1, 0, (-1)^n*sumdiv(n^2, d, (-1)^d*d))}
for(n=1, 64, print1(a(n), ", "))
(PARI) a(n) = if(n%2, sigma(n^2), 4*sigma(n^2/2) - sigma(n^2)) \\ Andrew Howroyd, Jul 28 2018
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Paul D. Hanna, Apr 03 2013
STATUS
approved