Find all triples $(p, q, r)$ of primes such that $p – 2q + r = 1$ and $p^3 – 2q^3 + (4r)^3 = 2023$.

algebra-precalculuselementary-number-theory

Problem

Find all triples $(p, q, r)$ of primes such that
$p – 2q + r = 1$ and $p^3 – 2q^3 + (4r)^3 = 2023$.

This problem is from the algebra round of a local high school competition that has already ended.

Almost Solved! (With help from dxiv and insipidintegrator)

We can rearrange the first equation as $p + r = 2q + 1$. Since $2q + 1$ is always odd, either $p$ or $r$ must be even. The only even prime number is $2$.

Case 1: $p = 2$

If $p = 2$, then the equation $p + r = 2q + 1$ becomes $r = 2q – 1$. Substituting this value of r into the second equation, we have:

$8 – 2q^3 + 64(2q – 1)^3 = 2023$.

This equation does not work because the sum of two even numbers can not equal an odd number. Therefore, case 1 does not work.

Case 2: $r = 2$

If $r = 2$, then the equation $p + r = 2q + 1$ becomes $p = 2q – 1$. Substituting this value of $p$ into the second equation, we have:

$(2q – 1)^3 – 2q^3 + (4(2))^3 = 2023$.

Expanding and simplifying:

$6q^3 – 12q^2 + 6q – 1 + 512 = 2023$,
$6q^3 – 12q^2 + 6q = 1512$.

Dividing by 6, we get:

$q^3 – 2q^2 + q – 252 = 0$.

It would take so long if I try to use rational root theorem to solve this.

Is there any better way to solve this cubic? Also, has all my steps been correct so far? Thank you!

Best Answer

The $2$ simultaneous equations to solve are:

$$p-2q+r=1,\;\;p^3-2q^3+(4r)^3=2023 \tag{1}\label{eq1A}$$

Since $2023$ is odd, the second equation shows $p$ must be odd. The first equation then shows that $r$ must be even, i.e., it's $2$ as that's the only even prime. Thus, $p = 2q - 1$ from the first equation in \eqref{eq1A} which, when substituted in the second one, gives

$$\begin{equation}\begin{aligned} (2q-1)^3-2q^3+8^3 &= 2023 \\ (8q^3 - 12q^2 + 6q - 1) - 2q^3 + 512 & = 2023 \\ 6q^3 - 12q^2 + 6q - 1512 & = 0 \\ q^3 - 2q^2 + q - 252 & = 0 \end{aligned}\end{equation}\tag{2}\label{eq2A}$$

As we're looking only for primes $q$, note the first prime where its cube is about $252$ is $7$ (with $7^3 = 343$ being somewhat larger). Alternatively, we can relatively quickly determine $9$ divides $252$ since $2+5+2=9$, and it also has a factor of $4$ (since $4 \mid 52$ and $4 \mid 200$), so factoring gives $252 = 4(9)(7)$. The Rational root theorem (RRT) then indicates $7$ is a possible factor.

Since $q = 7$ satisfies \eqref{eq2A}, then $q - 7$ can be factored out to get the remaining factor of $q^2 + 5q + 36$. However, the discriminant of this quadratic polynomial is $\Delta = 5^2 - 4(36) = -119 \lt 0$, so it has no real factors (also, the RRT indicates the only other possible prime factors $q$ of \eqref{eq2A} are $2$ and $3$, but neither satisfy the equation). Thus, the only solution is

$$(r,p,q) = (2,13,7) \tag{3}\label{eq3A}$$