Subfield: Number Theory


Question: Let $k$ be a positive integer and let $S$ be a finite set of odd prime numbers. Prove that there is at most one way (modulo rotation and reflection) to place the elements of $S$ around a circle such that the product of any two neighbors is of the form $x^{2}+x+k$ for some positive integer $x$.

Solution:
Let us allow the value $x=0$ as well; we prove the same statement under this more general constraint. Obviously that implies the statement with the original conditions.

Call a pair $\{p, q\}$ of primes with $p \neq q$ special if $p q=x^{2}+x+k$ for some nonnegative integer $x$. The following claim is the key mechanism of the problem:

Claim.

(a) For every prime $r$, there are at most two primes less than $r$ forming a special pair with $r$.

(b) If such $p$ and $q$ exist, then $\{p, q\}$ is itself special.

We present two proofs of the claim.

Proof 1. We are interested in integers $1 \leqslant x<r$ satsfying
$$
x^{2}+x+k \equiv 0 \quad(\bmod r)
\tag{1}
$$
Since there are at most two residues modulo $r$ that can satisfy that quadratic congruence, there are at most two possible values of $x$. That proves (a).

Now suppose there are primes $p, q$ with $p<q<r$ and nonnegative integers $x, y$ such that
$$
\begin{aligned}
& x^{2}+x+k=p r \\
& y^{2}+y+k=q r .
\end{aligned}
$$
From $p<q<r$ we can see that $0 \leqslant x<y \leqslant r-1$. The numbers $x, y$ are the two solutions of (1); by Vieta's formulas, we should have $x+y \equiv-1(\bmod r)$, so $x+y=r-1$.

Letting $K=4 k-1, X=2 x+1$, and $Y=2 y+1$, we obtain
$$
\begin{gathered}
4 p r=X^{2}+K, \\
4 q r=Y^{2}+K
\end{gathered}
$$
with $X+Y=2 r$. Multiplying the two above equations,
$$
\begin{aligned}
16 p q r^{2} & =\left(X^{2}+K\right)\left(Y^{2}+K\right) \\
& =(X Y-K)^{2}+K(X+Y)^{2} \\
& =(X Y-K)^{2}+4 K r^{2}, \\
4 p q & =\left(\frac{X Y-K}{2 r}\right)^{2}+K .
\end{aligned}
$$
In particular, the number $Z=\frac{X Y-K}{2 r}$ should be an integer, and so $4 p q=Z^{2}+K$. By parity, $Z$ is odd, and thus
$$
p q=z^{2}+z+k \quad \text { where } z=\frac{Z-1}{2},
$$
so $\{p, q\}$ is special.



Proof 2. As before, we suppose that
$$
\begin{aligned}
& x^{2}+x+k=p r \\
& y^{2}+y+k=q r .
\end{aligned}
$$
Subtracting, we have
$$
(x+y+1)(x-y)=r(p-q) \text {. }
$$
As before, we have $x+y=r-1$, so $x-y=p-q$, and
$$
\begin{aligned}
& x=\frac{1}{2}(r+p-q-1) \\
& y=\frac{1}{2}(r+q-p-1)
\end{aligned}
$$
Then,
$$
\begin{aligned}
k=p r-x^{2}-x & =\frac{1}{4}\left(4 p r-(r+p-q-1)^{2}-2(r+p-q-1)\right) \\
& =\frac{1}{4}\left(4 p r-(r+p-q)^{2}+1\right) \\
& =\frac{1}{4}\left(2 p q+2 p r+2 q r-p^{2}-q^{2}-r^{2}+1\right)
\end{aligned}
$$
which is symmetric in $p, q, r$, so
$$
p q=z^{2}+z+k \quad \text { where } z=\frac{1}{2}(p+q-r-1)
$$
and $\{p, q\}$ is special.

Now we settle the problem by induction on $|S|$, with $|S| \leqslant 3$ clear.

Suppose we have proven it for $|S|=n$ and consider $|S|=n+1$. Let $r$ be the largest prime in $S$; the claim tells us that in any valid cycle of primes:

- the neighbors of $r$ are uniquely determined, and
- removing $r$ from the cycle results in a smaller valid cycle.

It follows that there is at most one valid cycle, completing the inductive step.