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

It's given ($p$ is a prime): $$ x^2-dy^2 \equiv 1\pmod p $$ Using only this can we say $$ x^2-dy^2 = 1 $$ has always integral solution?

share|cite|improve this question
What is your quantifier? "For all primes p" or "For some prime p" ? – Nate Iverson Jun 28 '12 at 13:02
Assuming $d$ is a given integer and $x,y$ are unknown then $x^2-dy^2=1$ always has an integral solution, namely, $x=\pm1$, $y=0$. If $d$ is a square, that's the only solution. If $d\gt1$ is not a square, this is Pell's equation, and it is guaranteed to have infinitely many solutions. – Gerry Myerson Jun 28 '12 at 13:24
I do not understand the question. If it is from a book or notes, perhaps you could give more detail. – André Nicolas Jun 28 '12 at 17:59

If $=1 \pmod p$ actually means $\equiv \pmod p$,

$\implies x^2-1 \equiv dy^2 \pmod p$

Observe that if $p$ |LHS, $x≡±1 \pmod p$, then $p|dy^2$.

  1. if $p∤d$ i.e., $(p,d)=1, p|y$ for accepting solution.
  2. if $p|d$, any integral $y$ will give us integral solution.
share|cite|improve this answer

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.