# Primes congruent to 1 (mod 3)

Assume that $x, y$ are integers, and $f(x,y) = x^{4} - 2x^{3} y + x^{2} y^{2} - y^{4}$ is a prime number greater than $3$. Prove that $f(x,y) \equiv 1 \pmod{3}$. For example, $f(34,21) = 883$ is a prime and $883 \equiv 1 \pmod{3}$. [ Hint: $x^{4} - 2x^{3} y + x^{2} y^{2} - y^{4} = (x^{2} - xy + y^{2})(x^{2} - xy - y^{2})$. ]

Ive tried many of the modular arithmetic tricks I know but I can't get around the fact that how can $f(x,y)$ be prime if it can be factored like in the hint

• The requirement is that the second factor is $\pm 1.$ In fact, given the conclusion, we demand the second factor $+1.$ – Will Jagy Mar 29 '17 at 3:03

Suppose $x, y$ are integers such that $$f(x,y) = x^{4} - 2x^{3} y + x^{2} y^{2} - y^{4} = p$$ where $p$ is prime, and $p > 3$.

The goal is to show that $p \equiv 1\;(\text{mod}\;3)$.

If $y = 0$, then $f(x,y) = x^4$, which can't be prime, hence $y \ne 0$.

As you noted, $f(x,y) = g(x,y)h(x,y)$, where \begin{align*} g(x,y) &= x^2 - xy + y^2\\[4pt] h(x,y) &= x^2 - xy - y^2\\[4pt] \end{align*}

For all real $t$, we have $t^2 - t + 1$ > 0, hence

\begin{align*} g(x,y) &= x^2 - xy + y^2\\[4pt] &=y^2(t^2 - t + 1),\;\text{where $t = x/y$}\\[4pt] &> 0\\[4pt] \end{align*}

Since $g(x,y) > 0,\;g(x,y)h(x,y) = p > 0 \implies h(x,y) > 0$.

Also, since $y \ne 0$, $x^2 - xy - y^2 < x^2 - xy + y^2$, hence $h(x,y) < g(x,y)$, so

\begin{align*} &g(x,y)h(x,y) = p\\[4pt] \implies\; &g(x,y) = p\;\,\text{and}\;h(x,y) = 1\\[4pt] \implies\; &(x^2 - xy + y^2) - (x^2 - xy - y^2) = p-1\\[4pt] \implies\; &p = 2y^2 + 1\\[4pt] \implies\; &p \equiv 0\;\,\text{or}\;1\;(\text{mod}\;3) \qquad\text{[since squares are congruent to $0$ or $1\;($mod$\;3)$]}\\[4pt] \implies\; &p \equiv 1\;(\text{mod}\;3)\qquad\qquad\text{[since $p>3$]}\\[4pt] \end{align*}

as was to be shown.