Consider the $n\times n$ matrices with elements in $\mathbb{Z}_{29}$. How many of these are invertible?
In total there are $29^{n^2}$ matrices of of dimension $n\times n$. Now I need to find how many of these are invertible modulo $29$. My plan of attack is to find how many are not invertible and then subtract this amount. A matrix $A$ is not invertible modulo 29 if and only if $$\det{(A)}\in\mathbb{Z}_{29}^\times\iff \gcd{(\det{A},29)}=1.$$
Now I'm not really sure how to advance any further. Clearly if $\det{A}<29$ then the gcd is $1$ since $29$ is prime, but how do we analyse larger determinants?