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
g4[n_] := Sum[If[GCD[x^2 + y^2+ z^2+ t^2, n] == 1, GCD[x^2 + y^2+ z^2+ t^2 - 1, n], 0], {x, 1, n}, {y, 1, n}, {z, 1, n}, {t, 1, n}]; Array[g4, 100]
PROG
(PARI) a(n) = {s = 0; for (x=1, n, for (y=1, n, for (z=1, n, for (t=1, n, if (gcd(x^2+y^2+z^2+t^2, n) == 1, s += gcd(x^2+y^2+z^2+t^2-1, n)); ); ); ); ); s; } \\ Michel Marcus, Jun 29 2014
(PARI) a(n)={my(p=lift(Mod(sum(i=0, n-1, x^(i^2%n)), x^n-1)^4)); sum(i=0, n-1, if(gcd(i, n)==1, polcoeff(p, i)*gcd((i-1)%n, n)))} \\ Andrew Howroyd, Aug 07 2018
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
José María Grau Ribas, Jun 25 2014
EXTENSIONS
Keyword:mult added by Andrew Howroyd, Aug 07 2018
STATUS
approved