OFFSET
1,3
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
Multiplicative with a(p^e) = 1 if p = 2; ((p^2)^(e+1)-1)/(p^2-1) if p == 1 (mod 4); ((p^2)^(e+1)+(-1)^e)/(p^2+1) if p == 3 (mod 4). - Michael Somos, Aug 09 2006
MATHEMATICA
f[p_, e_] := If[Mod[p, 4] == 1, ((p^2)^(e+1)-1)/(p^2-1), ((p^2)^(e+1)+(-1)^e)/(p^2+1)]; f[2, e_] := 1; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 60] (* Amiram Eldar, Aug 28 2023 *)
PROG
(PARI) {a(n)=if(n<1, 0, abs(sumdiv(n, d, d^2*kronecker(-4, d))))} /* Michael Somos, Aug 09 2006 */
(PARI) {a(n)= local(A, p, e); if(n<1, 0, A=factor(n); prod(k=1, matsize(A)[1], if(p=A[k, 1], e=A[k, 2]; if(p==2, 1, if(p%4==1, ((p^2)^(e+1)-1)/(p^2-1), ((p^2)^(e+1)+(-1)^e)/(p^2+1)))))) } /* Michael Somos, Aug 09 2006 */
(PARI) {a(n)=if(n<1, 0, polcoeff( sum(k=1, n, x^k/(1+x^(2*k))*(k/2^valuation(k, 2))^2, x*O(x^n)), n))} /* Michael Somos, Aug 09 2006 */
CROSSREFS
KEYWORD
nonn,easy,mult
AUTHOR
Vladeta Jovovic, Feb 15 2004
EXTENSIONS
Edited by Michael Somos, Aug 09 2006
STATUS
approved