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

Let $a,b,c$ be integers. Is there a reasonably concise condition on $(a,b,c)$ which ensures that $$ax^2+bxy+cy^2=\pm 1$$ has a solution in integers $x,y$?

In addition to direct answers I would also appreciate references to the literature. Thanks.

share|cite|improve this question

A form represents 1 if it is equivalent to the principal form. There are algorithms for deciding this going back to Lagrange and Gauss, and which can be found e.g in Cohen's books on agorithmic number theory. If (a,b,c) represents -1, then (-a,-b,-c) represents 1.

share|cite|improve this answer

A way to decide whether $ax^2+bxy+cy^2=d$ has (integral) solutions is described in the ch. 1 of Conway's (excellent!) book «The Sensual (Quadratic) Form».

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.