# When does a binary quadratic form represent 1 or -1

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.

-
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».