[Mersenne primes](http://en.wikipedia.org/wiki/Mersenne_prime) are primes of the form $M\_n = 2^n - 1$. I'm wondering how many distinct natural numbers result from squaring the naturals modulo $M\_n$.

As an example, $M\_3 = 7$. If we take the naturals less than seven, we get:

$$1^2 \equiv 1 \bmod 7$$
$$2^2 \equiv 4 \bmod 7$$
$$3^2 \equiv 2 \bmod 7$$
$$4^2 \equiv 2 \bmod 7$$
$$5^2 \equiv 4 \bmod 7$$
$$6^2 \equiv 1 \bmod 7$$

Thus, there are $3$ distinct results of squaring; namely $1$, $2$, and $4$. So I'm wondering, for a given Mersenne prime $M\_n$, how many different squares can we get?