Best way to compute the rank of $A$ Let 
$$A=\begin{bmatrix}
 1&2&3&4&5\\6&7&8&9&10\\11&12&13&14&15\\16&17&18&19&20\\21&22&23&24&25\end{bmatrix}.$$
Which would be the best way to compute its rank?
I first thought about computing the determinant but then it seemed better to find its echelon form which would give me the rank. Is there a more efficient way?
I found out that the last three rows were spanned by the first two (So the rank is 2) but it was kind of a lucky thing so I can't expect to get it every time like that. 
 A: $$A=\begin{bmatrix}
 1&2&3&4&5\\6&7&8&9&10\\11&12&13&14&15\\16&17&18&19&20\\21&22&23&24&25\end{bmatrix}.$$
Removing the first row from the third and last row . And removing the second row from the fourth row give $A$ in $\Bbb Z_2$ gives, 
$$A'=\begin{bmatrix}
 1&2&3&4&5\\6&7&8&9&10\\10&10&10&10&10\\10&10&10&10&10\\20&20&20&20&20\end{bmatrix}.$$
Removing the first row to the second gives 
$$A''=\begin{bmatrix}
 1&2&3&4&5\\5&5&5&5&5\\10&10&10&10&10\\10&10&10&10&10\\20&20&20&20&20\end{bmatrix}.$$
then  $$rank (A )=rank (A')=rank (A'') = 2$$
A: These are generalized cell phone keypad matrices, i.e., containg the consecutive numbers $1,2\ldots ,n^2$, for $n\ge 3$. The name comes from the case $n=3$:
$$
A=\begin{pmatrix}
        1 & 2 & 3 \\
        4 & 5 & 6 \\
        7 & 8 & 9 \\
        \end{pmatrix}
$$
They have rank $2$ for all $n\ge 3$, because adding the first and third row gives two times the second row, as we see directly here for $n=3$. This can be easily generalized to $n\times n$ hyper-cell phone matrices, for all $n\ge 3$. So you were not just lucky, but this always works.
A: For such matrices you can always use the matrix of the form 
$$
T = \begin{bmatrix}
1& 0& 0& 0& 0 \\
-1& 1& 0& 0& 0 \\
0& -1& 1& 0& 0 \\
0& 0& -1& 1& 0 \\
0& 0& 0& -1& 1
\end{bmatrix}
$$
which is full rank and then $T^T A T$ will give you
$$
\begin{bmatrix} 
 0&  0 & 0 & 0& -5\\
 0&  0 & 0 & 0& -5\\
 0&  0 & 0 & 0 &-5\\
 0&  0 & 0 & 0 &-5\\
-1& -1 &-1 &-1 &25
\end{bmatrix}
$$
In Python 
import numpy as np
T = np.eye(5) - np.diag(np.ones(4),k=-1)
A = np.arange(1,26).reshape(5,5)
T.T @ A @ T

would give 
array([[ 0.,  0.,  0.,  0., -5.],
       [ 0.,  0.,  0.,  0., -5.],
       [ 0.,  0.,  0.,  0., -5.],
       [ 0.,  0.,  0.,  0., -5.],
       [-1., -1., -1., -1., 25.]])

A: You can notice that if $a=[1\ 2\ 3\ 4 \ 5]$ and $u=[1\ 1\ 1\ 1\ 1]$, then the matrix is
$$
\begin{bmatrix}
a \\
a + 5u \\
a + 10u \\
a + 15u \\
a + 20u
\end{bmatrix}
$$
and it is clear that the row space is generated by $a$ and $u$.
