From: Timothy Murphy on
quadratic wrote:

> OK so far, now about the "and so on"--how many possibilities are there
> for the third row (any vector not a linear combination of the first
> two)? And the same for the last row? Thanks again.
>
>> > How does one determine how many invertible 4 × 4 matrices are there
>> > with entries in Z(5) (the integers mod 5)? Thanks.
>>
>> Probably a bit of geometry over F_5 = Z/(5).
>> First row can be any non zero vector: no = 5^4 - 1.
>> Second row can be any vector not a scalar multiple of the first:
>> no = 5^4 - 5.
>> And so on.

The next row must not be a linear combination of the first two,
ie it must not lie in a 2-dimensional vector subspace.

The number of elements in an r-dimensional vector space over F_q
is q^r.