TITLE: $p = (u + v)^2 + uv$ for primes $p = 5k \pm 1$?
QUESTION [7 upvotes]: I came up with the following conjecture which I am unable to prove.
For all primes $p$ which can be represented as either $5k + 1$ or $5k - 1$ for some positive integer $k$, we can find positive integers $u$, $v$ such that
$p = (u + v)^2 + u \times v$
For example,
$31 = 5 \times 6 + 1 = (2 + 3)^2 + 2 \times 3$
Using a computer, I have verified it for $p < 10000$.
Is there a general proof for this?

REPLY [5 votes]: We'd like to use some algebraic number theory (Kummer-Dedekind) to prove this, and in order to do that, we need to link $(u+v)^2+uv$ to the norm of some quadratic extension of $\mathbb{Q}$. This must be possible, because $(u+v)^2+uv$ is homogeneous of degree $2$. Let $\varphi:=\frac12(1+\sqrt{5})$ be the golden ratio, then:
$$
\begin{align*}
(u+v)^2+uv&=0\\
(u/v)^2+3(u/v)+1&=0\\
u/v&=\frac12(-3\pm\sqrt{5})\\
u/v&\in\{\varphi-2,-\varphi-1\}.
\end{align*}
$$
Now we find that
$$
\begin{align*}
u^2+v^2+3uv &=  (u-(\varphi-2)v)(u+(\varphi+1)v)\\
&=\left((u+2v)-\varphi v\right)\left((u+2v)-\bar{\varphi}v\right)\\
&= N_{\mathbb{Q}(\varphi)/\mathbb{Q}}\left((u+2v)-\varphi v\right).
\end{align*}
$$

So if $p$ is a prime number, then $p$ can be written as $(u+v)^2+uv$ if and only if $\mathbb{Z}[\varphi]$ contains elements of norm $p$, which is to say that $(p)$ splits in $\mathbb{Z}[\varphi]$ as a product of principal ideals. By Kummer-Dedekind and the fact that the class number of $\mathbb{Z}[\varphi]$ is $1$, this is equivalent to $X^2-X-1$ splitting over $\mathbb{F}_p$.
Note that $X^2-X-1$ is irreducible over $\mathbb{F}_2$. For all odd primes $p$, its roots are given by $\frac12(1\pm\sqrt 5)$, so it splits as the product of two distinct linear factors if and only if $\left(\frac5p\right)=1$. Quadratic reciprocity gives that
$$
\left(\frac 5p\right)=\left(\frac p5\right)=\begin{cases}0\quad&\text{if $p=5$}\\1&\text{if $p\equiv \pm 1\pmod {5}$}\\-1&\text{if $p\equiv \pm 2\pmod 5$},\end{cases}
$$
so we can write $p=N_{\mathbb{Q}(\varphi)/\mathbb{Q}}(s+\varphi t)$ for integers $s,t$ if and only if $p\equiv \pm 1\pmod 5$ or $p=5$.