# Number of elements $GL(n,\mathbb{Z_p})$ [duplicate]

I want to find the number of elements of $GL(n,\mathbb{Z_p})$, $p$ prime. For $p=2$ I got 6 elements since one of diagonals has to be $0$ and the other $1$. But how should I deal with an arbitrary $n$ ? The expression for the determinant gets complicated.

## marked as duplicate by Derek Holt group-theory StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Apr 26 '17 at 12:53

1. The number of elements of $GL(n,\mathbb{Z_p})$ is the number of basis of $\mathbb{Z_p}^n$.
2. To count the basis of $\mathbb{Z_p}^n$, firstly you chose a non zero vector , so you have $p^n-1$ choices, then to choose the secon vector its must be non zero zero and not colinear with the previous one so you have $p^n-p$ choices. By continuing this reassoning you get : $$|GL(n,\mathbb{Z_p})|=(p^n-1)(p^n-p)\dots(p^n-p^{n-1})$$