A210000
Number of unimodular 2 X 2 matrices having all terms in {0,1,...,n}.
Original entry on oeis.org
0, 6, 14, 30, 46, 78, 94, 142, 174, 222, 254, 334, 366, 462, 510, 574, 638, 766, 814, 958, 1022, 1118, 1198, 1374, 1438, 1598, 1694, 1838, 1934, 2158, 2222, 2462, 2590, 2750, 2878, 3070, 3166, 3454, 3598, 3790, 3918, 4238, 4334, 4670, 4830
Offset: 0
a(2)=6 counts these matrices (using reduced matrix notation):
(1,0,0,1), determinant = 1, inverse = (1,0,0,1)
(1,0,1,1), determinant = 1, inverse = (1,0,-1,1)
(1,1,0,1), determinant = 1, inverse = (1,-1,0,1)
(0,1,1,0), determinant = -1, inverse = (0,1,1,0)
(0,1,1,1), determinant = -1, inverse = (-1,1,1,0)
(1,1,1,0), determinant = -1, inverse = (0,1,1,-1)
See also the very useful list of cross-references in the Comments section.
-
a = 0; b = n; z1 = 50;
t[n_] := t[n] = Flatten[Table[w*z - x*y, {w, a, b}, {x, a, b}, {y, a, b}, {z, a, b}]]
c[n_, k_] := c[n, k] = Count[t[n], k]
Table[c[n, 0], {n, 0, z1}] (* A059306 *)
Table[c[n, 1], {n, 0, z1}] (* A171503 *)
2 % (* A210000 *)
Table[c[n, 2], {n, 0, z1}] (* A209973 *)
%/4 (* A209974 *)
Table[c[n, 3], {n, 0, z1}] (* A209975 *)
Table[c[n, 4], {n, 0, z1}] (* A209976 *)
Table[c[n, 5], {n, 0, z1}] (* A209977 *)
A211031
Number of 2 X 2 matrices having all elements in {0,1,...,n} and determinant in the closed interval [-n,n].
Original entry on oeis.org
1, 16, 69, 176, 375, 650, 1107, 1626, 2413, 3326, 4527, 5782, 7689, 9436, 11753, 14354, 17491, 20458, 24623, 28334, 33425, 38438, 44031, 49450, 57323, 64028, 71849, 80078, 89857, 98468, 110545, 120388, 133117, 145382, 158699, 172256
Offset: 0
-
a = 0; b = n; z1 = 40;
t[n_] := t[n] = Flatten[Table[w*z - x*y, {w, a, b}, {x, a, b}, {y, a, b}, {z, a, b}]]
c[n_, k_] := c[n, k] = Count[t[n], k]
c1[n_, m_] := c1[n, m] = Sum[c[n, k], {k, -n, m}]
Table[c1[n, n], {n, 0, z1}] (* A211031 *)
-
import numpy as np
def A211031_gen(limit):
yield 1
offset = limit + 1
size = offset * offset + 1
# a[offset+k] is the number of solutions to i*j = k with i,j in {0, 1, 2, ..., n}
a = np.zeros(size, dtype=np.int64)
a[offset] = 1
for n in range(1, offset):
a[offset: offset + n*n: n] += 2
a[offset + n*n] += 1
lag = 2*n + 1
c = np.cumsum(a)
c = c[lag:] - c[:-lag]
a1 = a[n+1: -n]
yield int(a1 @ c)
print(list(A211031_gen(35))) # David Radcliffe, Aug 15 2025
A279273
Number of 2 X 2 matrices having entries in {0,1,...,n} and determinant in the open interval (-n,n) with no entry repeated.
Original entry on oeis.org
0, 0, 0, 8, 40, 104, 216, 440, 720, 1160, 1656, 2432, 3216, 4472, 5680, 7280, 9128, 11328, 13504, 16632, 19424, 23216, 27088, 31600, 35832, 41912, 47192, 53544, 60152, 68192, 75168
Offset: 0
Cf.
A211032 (where the entries can be repeated).
-
def t(n):
s=0
for a in range(0,n+1):
for b in range(0,n+1):
for c in range(0,n+1):
for d in range(0,n+1):
if (a!=b and a!=d and b!=d and c!=a and c!=b and c!=d):
if (a*d-b*c) in range(-n+1,n):
s+=1
return s
for i in range(0,122):
print(f"{i} {t(i)}")
Showing 1-3 of 3 results.
Comments