# Rank of a matrix with prime entries

Recently, I came across an interesting problem:

Consider a matrix $$A\in M(3\times 3)$$ whose entries are (pairwise different) prime numbers. What values $$\operatorname{rank}(A)$$ can take?

At first, I thought it must be that $$\operatorname{rank}(A) = 3$$. However, a bit of computation proved that my intuition was incorrect as the rank can be lower $$\operatorname{rank}\begin{pmatrix} 5 & 7 & 11\\ 17 & 19 & 23 \\ 41 & 43 & 47 \end{pmatrix} = 2.$$

Although the problem is technically solved, I'm curious if there are some additional conditions on entries under which such matrices are of maximal rank.

I attacked the problem with Bézout's identity and managed to obtain some identities, but its rather messy and I don't like it at all. My questions would be then: (1) is there any reasonable answer to this problem? (2) what happens in case $$A\in M(n\times n)$$ when $$n>3$$?

This is probably overkill, but the Green-Tao Theorem guarantees that you can get rank-two for any $$n$$: take an arithmetic progression of length $$n^2$$ and the difference between rows will be constant. Using arithmetic progressions of different step you should then achieve any rank
For matrices in $$M(n\times n)$$ Rank 2 can be attained by using the Green-Tao Theorem referenced by @Martin Argerami.
Let the elements of the matrix be the terms of the AP entered sequentially from left to right and from top top to bottom. Subtracting each Row $$i$$ from Row $$i+1$$, for $$1\le i, reduces all elements outside the top row to $$n$$ times the common difference and so the matrix has Rank 2.