OFFSET
1,2
COMMENTS
Note that A115225 gives the number of 3 x 3 symmetric matrices having nonzero determinant. However, for composite n, a nonzero determinant is not sufficient for the matrix to be invertible; the determinant must also be relatively prime to n.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
For prime p, a(p) = (p^3-1)*(p-1)*p^2.
Multiplicative with a(p^e) = p^(6*e - 4)*(p^3 - 1)*(p - 1). - Amiram Eldar, Sep 10 2020
Sum_{k>=1} 1/a(k) = Product_{primes p} (1 + p^4/((p-1)^3 * (p^2+p+1)^2 * (p^3+1))) = 1.03859354030263389220782701124174403591851545785245128014455467710993780757... - Vaclav Kotesovec, Sep 20 2020
Sum_{k=1..n} a(k) ~ c * n^7, where c = (1/7) * Product_{p prime} (1 - 1/p^2 - 1/p^4 + 1/p^5) = 0.08230753362... . - Amiram Eldar, Nov 05 2022
MATHEMATICA
Table[cnt=0; Do[m={{a, b, c}, {b, d, e}, {c, e, f}}; If[Det[m, Modulus->n]>0 && MatrixQ[Inverse[m, Modulus->n]], cnt++ ], {a, 0, n-1}, {b, 0, n-1}, {c, 0, n-1}, {d, 0, n-1}, {e, 0, n-1}, {f, 0, n-1}]; cnt, {n, 2, 20}]
f[p_, e_] := p^(6*e - 4)*(p^3 - 1)*(p - 1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 10 2020 *)
PROG
(PARI) a(n) = {my(f = factor(n)); prod(i = 1, #f~, f[i, 1]^(6*f[i, 2] - 4)*(f[i, 1]^3 - 1)*(f[i, 1] - 1)); } \\ Amiram Eldar, Nov 05 2022
CROSSREFS
KEYWORD
mult,nonn,easy
AUTHOR
T. D. Noe, Jan 16 2006
EXTENSIONS
More terms from Amiram Eldar, Sep 10 2020
STATUS
approved