Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Find all primes $p$ such that $\dfrac{(2^{p-1}-1)}{p}$ is a perfect square. I tried brute-force method and tried to find some pattern. I got $p=3,7$ as solutions . Apart from these I have tried for many other primes but couldn't find any other such prime. Are these the only primes that satisfy the condition ? .

If yes , how to prove it theoretically and if not, how to find others?.

Thanks in advance!!

share|cite|improve this question
up vote 12 down vote accepted

Hint: Let $p=2k+1$ where $k \in \mathbb{N},$ then $2^{2k}-1=(2^k-1)(2^k+1)=pm^2.$ We have that $\gcd(2^k-1,2^k+1)=1$ since they are consecutive odd numbers, so the equation breaks into $2^k-1=px^2, 2^k+1=y^2$ or $2^k-1=x^2, 2^k+1=py^2.$ Easy investigation shows that the only solutions are $p=3,7.$ I will leave it to you to fill the gaps.

You may also interested in this.

share|cite|improve this answer
Very good explanation.. +1. – Iyengar Jun 22 '12 at 16:35
@ehsanmo: thanks.your hint really helped. – Aang Jun 22 '12 at 18:32
Glad to hear that :) – Ehsan M. Kermani Jun 22 '12 at 18:50
how to solve this equations? – agustin Mar 8 '13 at 7:22
@Avatar how to solve this equations? with answers$3,7$ – agustin Mar 9 '13 at 20:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.