A005353
Number of 2 X 2 matrices with entries mod n and nonzero determinant.
Original entry on oeis.org
0, 6, 48, 168, 480, 966, 2016, 3360, 5616, 8550, 13200, 17832, 26208, 34566, 45840, 59520, 78336, 95526, 123120, 147240, 181776, 219846, 267168, 307488, 372000, 433446, 505440, 580776, 682080, 762150, 892800, 999936, 1138368, 1284486
Offset: 1
- T. Brenner, personal communication.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
-
Table[cnt=0; Do[m={{a, b}, {c, d}}; If[Det[m, Modulus->p] > 0, cnt++ ], {a, 0, p-1}, {b, 0, p-1}, {c, 0, p-1}, {d, 0, p-1}]; cnt, {p, 37}] (* T. D. Noe, Jan 12 2006 *)
f[p_, e_] := p^(2*e - 1)*(p^(e + 1) + p^e - 1); a[1] = 0; a[n_] := n^4 - Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Oct 31 2023 *)
-
a(n) = {my(f = factor(n), p, e); n^4 - prod(i = 1, #f~, p = f[i, 1]; e = f[i, 2]; p^(2*e - 1)*(p^(e + 1) + p^e - 1));} \\ Amiram Eldar, Oct 31 2023
A240547
Number of non-congruent solutions of x^2 + y^2 + z^2 + t^2 == 0 mod n.
Original entry on oeis.org
1, 8, 33, 32, 145, 264, 385, 128, 945, 1160, 1441, 1056, 2353, 3080, 4785, 512, 5185, 7560, 7201, 4640, 12705, 11528, 12673, 4224, 18625, 18824, 26001, 12320, 25201, 38280, 30721, 2048, 47553, 41480, 55825, 30240, 51985, 57608, 77649, 18560, 70561, 101640
Offset: 1
For n=2 the a(2)=8 solutions are (0,0,0,0), (1,1,0,0), (1,0,1,0), (1,0,0,1), (0,1,1,0), (0,1,0,1), (0,0,1,1), (1,1,1,1).
-
A240547 := proc(n) local a, x, y, z, t ; a := 0 ; for x from 0 to n-1 do for y
from 0 to n-1 do for z from 0 to n-1 do for t from 0 to n-1 do if
(x^2+y^2+z^2+t^2) mod n = 0 mod n then a := a+1 ; fi; od; od ; od; od;
a ; end proc;
# alternative
A240547 := proc(n)
a := 1;
for pe in ifactors(n)[2] do
p := op(1,pe) ;
e := op(2,pe) ;
if p = 2 then
a := a*p^(2*e+1) ;
else
a := a* p^(2*e-1)*(p^(e+1)+p^e-1) ;
end if;
end do:
a ;
end proc:
seq(A240547(n),n=1..100) ; # R. J. Mathar, Jun 25 2018
-
b[2, e_] := 2^(2 e + 1);
b[p_, e_] := p^(2 e - 1)*(p^(e + 1) + p^e - 1);
a[n_] := Times @@ b @@@ FactorInteger[n];
Array[a, 42] (* Jean-François Alcover, Dec 05 2017 *)
-
a(n) = my(m); if( n<1, 0, forvec( v = vector(4, i, [0, n-1]), m += (0 == norml2(v)%n))); m /* Michael Somos, Apr 07 2014 */
-
a(n) = {my(f = factor(n), res = 1, start = 1, p, e, i); if(n % 2 == 0, res = 1<<(f[1,2]<<1+1); start = 2); for(i = start, #f~, p = f[i, 1]; e = f[i, 2]; res*=(p^(e<<1-1)*(p^(e+1)+p^e-1))); res} \\ David A. Corneth, Jul 22 2018
A115075
Number of 2 X 2 symmetric matrices over Z(n) having determinant 0.
Original entry on oeis.org
1, 4, 9, 20, 25, 36, 49, 80, 99, 100, 121, 180, 169, 196, 225, 352, 289, 396, 361, 500, 441, 484, 529, 720, 725, 676, 891, 980, 841, 900, 961, 1408, 1089, 1156, 1225, 1980, 1369, 1444, 1521, 2000, 1681, 1764, 1849, 2420, 2475, 2116, 2209, 3168, 2695, 2900
Offset: 1
-
Table[cnt=0; Do[m={{a, b}, {b, c}}; If[Det[m, Modulus->n]==0, cnt++ ], {a, 0, n-1}, {b, 0, n-1}, {c, 0, n-1}]; cnt, {n, 50}]
f[p_, e_] := p^e*(p^e + p^(e-1) - p^(Ceiling[e/2] - 1)); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Oct 31 2023 *)
-
a(n) = {my(f = factor(n), p, e); prod(i = 1, #f~, p = f[i, 1]; e = f[i, 2]; p^e*(p^e + p^(e-1) - p^((e+1)\2 - 1)));} \\ Amiram Eldar, Oct 31 2023
A181107
Triangle read by rows: T(n,k) is the number of 2 X 2 matrices over Z(n) having determinant congruent to k mod n, 1 <= n, 0 <= k <= n-1.
Original entry on oeis.org
1, 10, 6, 33, 24, 24, 88, 48, 72, 48, 145, 120, 120, 120, 120, 330, 144, 240, 198, 240, 144, 385, 336, 336, 336, 336, 336, 336, 736, 384, 576, 384, 672, 384, 576, 384, 945, 648, 648, 864, 648, 648, 864, 648, 648, 1450, 720, 1200, 720, 1200, 870, 1200, 720, 1200, 720
Offset: 1
From _Andrew Howroyd_, Jul 16 2018: (Start)
Triangle begins:
1;
10, 6;
33, 24, 24;
88, 48, 72, 48;
145, 120, 120, 120, 120;
330, 144, 240, 198, 240, 144;
385, 336, 336, 336, 336, 336, 336;
736, 384, 576, 384, 672, 384, 576, 384;
945, 648, 648, 864, 648, 648, 864, 648, 648;
... (End)
- Erdos Pal, Rows n=1..100 of triangle, flattened
- Richard P. Brent and Brendan D. McKay, Determinants and ranks of random matrices over Z_m, Discrete Mathematics 66 (1987) pp. 35-49.
- A. K. Gupta, Generalized hidden hexagon squares, The Fibonacci Quarterly, Vol 12, Number 1, Feb.1974, pp. 45-46.
- S. Hitotumatu, D. Sato, Star of David theorem (I), The Fibonacci Quarterly, Vol 13, Number 1, Feb.1975, p. 70.
-
(* computing T(p^e,k) ; p=prime, 1<=e, 0<=k
-
S(p,e)={my(u=vector(p^e)); my(t=(p-1)*p^(e-1)); u[1] = p^e + e*t; for(j=1, p^e-1, u[j+1] = t*(1+valuation(j, p))); vector(#u, k, sum(j=0, #u-1, u[j + 1]*u[(j+k-1) % #u + 1]))}
T(n)={my(f=factor(n), v=vector(n,i,1)); for(i=1, #f~, my(r=S(f[i,1], f[i,2])); for(j=0, #v-1, v[j + 1] *= r[j % #r + 1])); v}
for(n=1, 10, print(T(n))); \\ Andrew Howroyd, Jul 16 2018
A345754
Number of 2 X 2 matrices over Z_n whose permanent equals their determinant.
Original entry on oeis.org
1, 16, 45, 192, 225, 720, 637, 2048, 1701, 3600, 2541, 8640, 4225, 10192, 10125, 20480, 9537, 27216, 13357, 43200, 28665, 40656, 23805, 92160, 40625, 67600, 59049, 122304, 47937, 162000, 58621, 196608, 114345, 152592, 143325, 326592, 99937, 213712, 190125
Offset: 1
-
a[n_] := a[n] = Sum[If[Mod[Permanent[{{a, b}, {c, d}}] - Det[{{a, b}, {c, d}}],n] == 0, 1, 0], {a, 0, n - 1}, {b, 0, n - 1}, {c, 0, n - 1}, {d,0, n - 1}] ; Array[a,22]
f[p_, e_] := p^(3*e - 1)*((p - 1)*e + p); f[2, e_] := (e + 1)*8^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 50] (* Amiram Eldar, Dec 06 2022 *)
Showing 1-5 of 5 results.
Comments