OFFSET
1,2
COMMENTS
a(1)=1 because the matrix of all zeros has determinant 0, but 0=1 (mod 1).
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..2500
FORMULA
Multiplicative with a(2^1) = 4, a(2^e) = 3*2^(2*e-2) for e > 1, a(p^e) = (p+1)*p^(2*e-1) for p mod 4 == 1, a(p^e) = (p-1)*p^(2*e-1) for p mod 4 == 3. - Andrew Howroyd, Jul 04 2018
Sum_{k=1..n} a(k) ~ c * n^3, where c = (5/(2*Pi^2)) * A175647 * A243380 = 0.282098596071... . - Amiram Eldar, Aug 28 2023
MATHEMATICA
Table[cnt=0; Do[m={{a, b}, {b, c}}; If[Det[m, Modulus->n]==1, cnt++ ], {a, 0, n-1}, {b, 0, n-1}, {c, 0, n-1}]; cnt, {n, 50}]
f[p_, e_] := If[Mod[p, 4] == 1, (p+1)*p^(2*e-1), (p-1)*p^(2*e-1)]; f[2, 1] = 4; f[2, e_] := 3*2^(2*e-2); a[n_] := Times @@ f @@@ FactorInteger[n]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Aug 28 2023 *)
PROG
(PARI) a(n)={my(v=vector(n)); for(i=0, n-1, for(j=0, n-1, v[i*j%n+1]++)); sum(i=0, n-1, v[(i^2+1)%n+1])} \\ Andrew Howroyd, Jul 04 2018
(PARI) a(n)={my(f=factor(n)); prod(i=1, #f~, my(p=f[i, 1], e=f[i, 2]); p^(2*e-1)*if(p==2, if(e==1, 2, 3/2), if(p%4==1, p+1, p-1)))} \\ Andrew Howroyd, Jul 04 2018
CROSSREFS
KEYWORD
mult,nonn,easy
AUTHOR
T. D. Noe, Jan 12 2006
STATUS
approved