OFFSET
1,2
COMMENTS
Related to Menon's identity. See Conclusions and further work section of the arXiv file linked.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..1000
C. Calderón, J. M. Grau, A. Oller-Marcen, L. Toth, Counting invertible sums of squares modulo n and a new generalization of Euler totient function, arXiv:1403.7878 [math.NT], 2014.
MATHEMATICA
a[n_] := Sum[Boole[GCD[x^2 + y^2 + z^2, n] == 1] GCD[x^2 + y^2 + z^2 - 1, n], {x, 1, n}, {y, 1, n}, {z, 1, n}]/(n EulerPhi[n]);
Array[a, 60] (* Jean-François Alcover, Nov 22 2018 *)
PROG
(PARI) a(n)={my(p=lift(Mod(sum(i=0, n-1, x^(i^2%n)), x^n-1)^3)); sum(i=0, n-1, if(gcd(i, n)==1, polcoeff(p, i)*gcd((i-1)%n, n)))/(n * eulerphi(n))} \\ Andrew Howroyd, Aug 07 2018
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
José María Grau Ribas, Jun 25 2014
STATUS
approved