There does not exist any integer $m$ such that $3n^2+3n+7=m^3$

I have this really hard problem that I am working on and I just don't seem to get it. The question is: let $n$ be a positive integer; prove that there does not exist any integer $m$ such that $3n^2+3n+7=m^3$.

Please explain in detail otherwise I might not understand. I am also open for any methods that might help. Thank you. Please help.


Taken mod $3$, the equation $3n^2+3n+7=m^3$ becomes $m^3\equiv1$ mod $3$, which implies $m\equiv1$ mod $3$. Writing $m=3k+1$ and expanding, we get

$$3n^2+3n+7=27k^3+27k+9k+1$$

which reduces to

$$n^2+n+2=9k^3+9k^2+3k$$

Taking this mod $3$ gives $n^2+n-1\equiv0$ mod $3$. If you multiply both sides by $4$, you can complete the square, and find that

$$(2n+1)^2\equiv2\mod3$$

But $2$ is not a square mod $3$, so the equation $3n^2+3n+7=m^3$ has no integer solutions.


I am making this community wiki because I'm really just unpacking the comments. With the right method, this problem may seem trivially easy, but it still requires a few tedious calculations and the answer is not instantaneously obvious, despite what some people may want you to believe.

We know that $m^3 \equiv 0, 1, 8 \pmod 9$ (if you doubt this, take the cube of any positive integer, add up its digits and repeat adding up digits until you only have a single digit left; a 9 is equivalent to 0).

Then $3n^2 \equiv 0, 3 \pmod 9$. And $3n \equiv 0, 3, 6 \pmod 9$, which suggests that $3n^2 + 3n \equiv 0, 3, 6 \pmod 9$ as well. You add 7 to these and you get $3n^2 + 3n \equiv 7, 1, 4 \pmod 9$.

Therefore we need $3n^2 + 3n \equiv 3 \pmod 9$ so that $3n^2 + 3n + 7 \equiv 1 \pmod 9$.

Enumerating the cases one by one:

  • If $n \equiv 0 \pmod 9$, then $3n^2 + 3n + 7 \equiv 0 + 0 + 7 = 7 \pmod 9$.
  • If $n \equiv 1 \pmod 9$, then $3n^2 + 3n + 7 \equiv 3 + 3 + 7 = 4 \pmod 9$.
  • If $n \equiv 2 \pmod 9$, then $3n^2 + 3n + 7 \equiv 3 + 6 + 7 = 7 \pmod 9$.
  • If $n \equiv 3 \pmod 9$, then $3n^2 + 3n + 7 \equiv 0 + 0 + 7 = 7 \pmod 9$.
  • If $n \equiv 4 \pmod 9$, then $3n^2 + 3n + 7 \equiv 3 + 3 + 7 = 4 \pmod 9$.
  • If $n \equiv 5 \pmod 9$, then $3n^2 + 3n + 7 \equiv 3 + 6 + 7 = 7 \pmod 9$.
  • If $n \equiv 6 \pmod 9$, then $3n^2 + 3n + 7 \equiv 0 + 0 + 7 = 7 \pmod 9$.
  • If $n \equiv 7 \pmod 9$, then $3n^2 + 3n + 7 \equiv 3 + 3 + 7 = 4 \pmod 9$.
  • If $n \equiv 8 \pmod 9$, then $3n^2 + 3n + 7 \equiv 3 + 6 + 7 = 7 \pmod 9$.

As it turns out, $3n^2 + 3n \equiv 3 \pmod 9$ is impossible. Thus we have shown that $3n^2 + 3n + 7$ lacks one of the characteristics of cubes and therefore can't be a cube.


If we had found an instance of the desired congruence modulo 9, that would have been insufficient to prove the equation does have solutions, even though the absence of the desired congruence does prove there are no solutions.

Also note that it's unnecessary to restrict $n$ to positive integers, since if $n$ is negative, then $n^2$ is positive, while $n = 0$ gives us 7, which is quite clearly not a cube.


Rewriting, you get $3n^2 + 3n = m^3 - 7$. Look at this $\bmod 18$: we get that $m^3 - 7 \equiv 12, 1, 2, 3, 10, \textrm{ or } 11 \bmod 18$, but $3n^2 + 3n \equiv 0 \textrm{ or } 6 \bmod 18$.