A115076 Number of 2 X 2 symmetric matrices over Z(n) having determinant 1.
1, 4, 6, 12, 30, 24, 42, 48, 54, 120, 110, 72, 182, 168, 180, 192, 306, 216, 342, 360, 252, 440, 506, 288, 750, 728, 486, 504, 870, 720, 930, 768, 660, 1224, 1260, 648, 1406, 1368, 1092, 1440, 1722, 1008, 1806, 1320, 1620, 2024, 2162, 1152, 2058, 3000
Offset: 1
Links
- Andrew Howroyd, Table of n, a(n) for n = 1..2500
Programs
-
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 *)
-
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
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
Comments