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

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.