Find all primes $p$ for which $\frac{2^{p-1}-1}p$ is a perfect square 
Find all primes p for which the quotient $\frac{2^{p-1}-1}p$ is a perfect square.

It is a number theory problem. By guessing I found the value of $p$ is 3. But how do I prove it and how do I found the other primes?
 A: Put $p = 2q+1$, then the expression is $\dfrac{4^q-1}{2q+1} = \dfrac{(2^q-1)(2^q+1)}{2q+1}$.
Now, since $2^q-1$  and $2^q+1$ are co prime, one of them must be a perfect square. Let $(2^q-1)(2^q+1)=pm^2$. Then two cases arise, namely that :
1) $2^q-1 = px^2,2^q+1 = y^2$
2) $2^q-1 = x^2,2^q+1 = py^2$
For the first case, note that $(y-1)(y+1) = 2^q \implies y+1=2^m,y-1=2^n$, which gives $2^m-2^n=2$, giving $m=2,n=1$. This gives the case $q=3$ and $p=7$.
The second case is solved by the fact that $2^q - 1$ , if $q \geq 2$ is congruent to $3$ modulo $4$, and hence cannot be a perfect square. So  this forces $q = 1$ to be checked, which gives $p = 3$ which works.
A: With $p=2q+1$, such that $q\ge1$:
$$\frac{2^{p-1}-1}p=\frac{2^{2q}-1}p=\frac{(2^q+1)(2^q-1)}p$$
Note that $\gcd(2^q+1,2^q-1)=1$. This means the two terms in the numerator have no common prime factors and $p$ must divide exactly one of them, leaving the other to be a perfect square.
But by Mihăilescu's theorem, $2^q+1=m^2$ has only the solution $q=3$ and $2^q-1=m^2$ has only the solution $q=1$. Therefore $\frac{2^{p-1}-1}p$ can only be a perfect square for $p=3,7$, both primes, and indeed they are.
$$\frac{2^{3-1}-1}3=1^2,\ \frac{2^{7-1}-1}7=3^2$$
