cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    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 *)

Formula

a(n) = A344372(n) * n^2 (conjectured).
From Sebastian Karlsson, Aug 31 2021: (Start)
The formula is correct. Proof:
Let A = ([a, b], [c, d]) be an arbitrary 2 X 2 matrix over Z_n. So det(A) = a*d - b*c and perm(A) = a*d + b*c. Then, det(A) = perm(A) iff -b*c = b*c, i.e., 2*b*c = 0.
Suppose first that n is odd. Then 2*b*c = 0 iff b*c = 0. The number of solutions to this equation over Z_n is A018804(n). Furthermore, the value of a and b in A can be anything, so there are n possible choices for a and n possible choices for b. Thus, there are n*n*A018804(n) = n^2 * A344372(n) matrices A over Z_n such that det(A) = perm(A).
Suppose now that n is even. Then 2*b*c = 0 in Z_n iff b'*c' = 0 in Z_{n/2}, where b' and c' are b and c reduced modulo n/2. The latter equation has A018804(n/2) distinct solutions in Z_{n/2}. As the preimage of both b' and c' contains precisely 2 elements each, the number of solutions to 2*b*c = 0 in Z_n is 2*2*A018804(n/2). Hence, a(n) = n*n*4*A018804(n/2) = n^2 * A344372(n). Q.E.D.
The formula implies that the sequence is multiplicative with a(2^e) = (e+1)*8^e, a(p^e) = p^(3*e-1)*((p-1)*e+p) for odd primes p. (End)