OFFSET
1,2
COMMENTS
Traces of these matrices are A221490.
EXAMPLE
For n=4, we consider the first n^2=16 terms of the characteristic function of primes (A010051): (0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0). These terms form a matrix by arranging them in 4 consecutive subsequences of 4 terms each:
0, 1, 1, 0;
1, 0, 1, 0;
0, 0, 1, 0;
1, 0, 0, 0;
and the largest square submatrix with a nonzero determinant within this matrix is of dimension 3. Therefore, the rank is 3, and so a(4)=3.
MAPLE
f:= proc(n) local i; LinearAlgebra:-Rank(Matrix(n, n, [seq(`if`(isprime(i), 1, 0), i=1..n^2)])) end proc:
map(f, [$1..100]); # Robert Israel, Nov 11 2023
MATHEMATICA
mat[n_, i_, j_]:=Boole[PrimeQ[(i-1)*n+j]];
a[n_]:=MatrixRank@Table[mat[n, i, j], {i, 1, n}, {j, 1, n}];
Table[a[n], {n, 1, 70}]
PROG
(PARI) a(n) = matrank(matrix(n, n, i, j, isprime((i-1)*n+j))); \\ Michel Marcus, Nov 07 2023
(Python)
from sympy import Matrix, isprime
def A367133(n): return Matrix(n, n, [int(isprime(i)) for i in range(1, n**2+1)]).rank() # Chai Wah Wu, Nov 16 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Andres Cicuttin, Nov 06 2023
STATUS
approved