Find all odd primes $p$ such that $3p-8$ is equal to the cube of a positive integer I recently tackled this problem from one of my country's regional competitions. My solution is as follows:
Let $$3p - 8 = n^3$$ From this we know that $$p = \frac{n^3 + 8}{3}$$ It follows that $$p = \frac{(n+2)(n^2 - 2n + 4)}{3}$$
Now, since $p$ is prime, we require $\frac{n + 2}{3} = 1$ or $n^2 - 2n + 4 = 1$. (not both, since then it would be $p = \frac{1}{3}$, which is a contradiction). From both of our conditions we obtain $n = 1$, and so $p = 3$.
The "accepted" solution to this problem looked at 4 total different cases and is way longer, but comes to the exact same result as mine. Is my solution inadequate?
 A: Or $n^2-2n+4=3$?
You cannot assume that $\frac {n+2}3$ is an integer. So your solution does not necessarily involve the factorisation of $p$ into integers.
A: I'd say that in getting the factorization of $p$ that you did is a crux of the problem, but you still had more math to do. You did not exhaust all possibilities. However, you could note the following:
Claim 1. If $a$ and $b$ are integers that are at least $4$ each, then either $\frac{ab}{3}$ is nonintegral or composite.
If $\frac{ab}{3}$ is integral, then at least one of $a,b$, say WLOG $b$, has $3$ as a factor. So write $b=3c$ for some integer $c$. Then $\frac{ab}{3} = ac$. However, that $a,b$ satisfy $a,b \ge 4$ gives $a \ge 4$ and $c \ge 2$. And so if $\frac{ab}{3}$ is integral then $\frac{ab}{3} = ac$, for some integer $c \ge 2$ and $a \ge 4$, and so then $\frac{ab}{3}$ must indeed be composite. ■
Then setting $a=n+2$, $b=n^2-2n+4$, it remains to find the set of positive integers $n$ such that $p =\frac{ab}{3}$ is both integral and prime. Fortunately both $a=n+2$, $b=n^2-2n+4$ is at least $4$ for all $n\ge 2$, so by Claim 1 all you need to check is $n=1$.
A: We can cut out a lot of casework by using modular arithmetic.
Modulo $3$, all residues are $\in\{-1,0,+1\}$ and thus equal to their own cubes. So $3p-8\equiv1\bmod3$ can be a cube only if its cube root has the form $3k+1$.
But by the Binomial Theorem
$(3k+1)^3=27k^3+27k^2+9k+1\equiv1\bmod9,$
forcing $3p-8\equiv1\bmod9$. This requires $p\equiv0\bmod3$ and thus admits $p=3$ as the only prime candidate.
