3

Is there always a solution to the equation in the field $\mathbb{Z}_p$ ($p$ being a prime number)

$$ a^2 + b^2 \equiv c \pmod p $$

for a given $c \in \mathbb{Z}_p$? The solution need not be unique, I only want to know if there exist such $a, b \in \mathbb{Z}_p$ that satisfy the equation.

Nerius
  • 159

2 Answers2

4

The prime $2$ is easy to deal with, so let $p$ be odd.

Consider (modulo $p$) the set $S$ of squares and the set $T$ of elements of the shape $c-b^2$.

The set $S$ has $\frac{p-1}{2}+1=\frac{p+1}{2}$ elements, as has the set $T$. Since $\frac{p+1}{2}+\frac{p+1}{2}\gt p$, the sets $S$ and $T$ must have at least one element in common.

2

The usual proof that $a^2+b^2\equiv -1\pmod p$ has a solution works more generally.

Let $A=\{x^2\mid x\in\mathbb Z_p\}$ and $B=\{c-y^2\mid y\in\mathbb Z_p\}$. Then $A$ and $B$ both have $\frac{p+1}{2}$ distinct elements, so they must have an element in common.

Thomas Andrews
  • 177,126