Trace of matrices with primes as elements I noticed this curious pattern that matrices composed of primes seem to have traces equal to or close to square numbers:
\begin{align}tr\begin{bmatrix}2&3\\5&7\end{bmatrix}=9=3^2\end{align}
\begin{align}tr\begin{bmatrix}2&3&5\\7&11&13\\17&19&23\end{bmatrix}=36=6^2\end{align}
\begin{align}tr\begin{bmatrix}2&3&5&7\\11&13&17&19\\23&29&31&37\\41&43&47&53\end{bmatrix}=99=10^2-1\end{align}
\begin{align}tr\begin{bmatrix}2&3&5&7&11\\13&17&19&23&29\\31&37&41&43&47\\53&59&61&67&71\\73&79&83&89&97\end{bmatrix}=224=15^2-1\end{align}
This can be generally written as:
$$\sum_{i=0}^{n-1} {p_{1+i(n+1)}}\leq (T_n)^2$$
Where n is the dimension of the matrix, $n\geq2$, p are the prime numbers, and $T_n$ are the triangular numbers.
Can someone please explain why this pattern exists?

I think this pattern exist, because these matrices are relatively small. If you take for example matrix of dimension $n=7$, then sum is equal to $724$, which is $3$ away from $27^2$.
Interesting thing happens when for $n=10$ it gives diagonal value of: $\sum=2,451$ which is in "the middle" of $49^2=2401$ and $50^2=2500$, however the pattern is not regular as the distance grow in size.
