Let $p$ be an odd prime number and $a,b,c$ be integers coprime with $p$. How many different pairs of integers $(x,y)$ modulo $p$ such that $ax^2+by^2+c \equiv 0\pmod{p}$ ?

Until now I haven't had any specific way to approach this problem. How can I find the number of solutions of the equation $ax^2+by^2+c \equiv 0\pmod{p}$ ? Or can it only be counted with some given conditions of $a,b,c$ ?

(Please let me know if I should add some details to this problem)

  • 2
    $\begingroup$ This question seems to be related with this one here: math.stackexchange.com/questions/1190423/… $\endgroup$ – Dr. Mathva Nov 26 '18 at 18:38
  • $\begingroup$ @Dr.Mathva Yes, thank you. However I am looking for the number of solutions, not just if a solution exists. $\endgroup$ – color Nov 26 '18 at 18:43
  • 1
    $\begingroup$ Let $\chi(n) = n^{(p-1)/2}= \pm 1, \chi(0) = 0$. Then there are $\sum_{x \bmod p} \chi(b^{-1})\chi(-ax^2-c)+\chi(b^{-1})^2\chi(-ax^2-c)^2$ solutions with $y \ne 0$. Can you go further assuming $-ac^{-1} = d^2$ ? $\endgroup$ – reuns Nov 27 '18 at 0:56

Suppose There is a number d which is prime to p such that we can write following relations (for a simple form let $c=-1$):

$d^{p-1}-1 ≡0\mod p$


If $y=0$ then:




That is $1,2,3, . . \frac{d^{(p-1)/2}}{a^{1/2}}$ can be the solutions for x, so number of solutions for x is $$\chi_x=\frac{d^{(p-1)/2}}{a^{1/2}}$$ . Clearly there will be corresponding value for y for each value of x. The equation is symmetric and the same argument could be applied for y, therefore:


That is the number of solutions for y is $$\chi_y=\frac{d^{(p-1)/2}}{b^{1/2}}$$ So the number of solution must be equal to:


You can exclude 1 from solutions and find better formula.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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