OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Catalina Calderón, Jose Maria Grau, A. Oller-Marcén, and László Tóth, Counting invertible sums of squares modulo n and a new generalization of Euler's totient function, Publicationes Mathematicae-Debrecen, Vol. 87 (1-2) (2015), pp. 133-145; arXiv preprint, arXiv:1403.7878 [math.NT], 2014.
FORMULA
Multiplicative: a(2^s) = 2^(4s-1); a(3^s) = 16*3^(4s-3); a(5^s) = 32*3*5^(4s-3).
From Amiram Eldar, Feb 13 2024: (Start)
Multiplicative with a(2^e) = 2^(4*e-1), and a(p^e) = p^(4*e-3) * (p-1)^2 * (p+1) for an odd prime p.
Dirichlet g.f.: zeta(s-4) * (1 - 1/2^(s-3)) * Product_{p prime > 2} (1 - 1/p^(s-3) - (p-1)/p^(s-1)).
Sum_{k=1..n} a(k) = (12/55) * c * n^5 + O(n^4 * log(n)), where c = Product_{p prime} (1 - 1/p^2 - 1/p^3 + 1/p^4) = 0.53589615382833799980... (Calderón et al., 2015).
Sum_{n>=1} 1/a(n) = (17*Pi^8/57240) * Product_{p prime} (1 - 2/p^2 + 1/p^4 + 1/p^5 + 2/p^6 - 1/p^8) = 1.16039588611967540703... . (End)
MATHEMATICA
cuater[n_] := Flatten[Table[{a, b, c, d}, {a, n}, {b, n}, {c, n}, {d, n}], 3]; a[n_] := Length@Select[cuater[n], GCD[#.#, n] == 1 &]; Array[a, 20]
f[p_, e_] := (p-1)*p^(4*e-1) * If[p == 2, 1, 1 - 1/p^2]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Feb 13 2024 *)
PROG
(PARI) a(n) = {my(f = factor(n)); prod(i = 1, #f~, p = f[i, 1]; e = f[i, 2]; (p-1)*p^(4*e-1) * if(p == 2, 1, 1 - 1/p^2)); } \\ Amiram Eldar, Feb 13 2024
CROSSREFS
KEYWORD
nonn,easy,mult
AUTHOR
José María Grau Ribas, Jul 13 2013
STATUS
approved