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.

• Hint: Work modulo $9$. – André Nicolas Apr 20 '16 at 20:11
• You could see this as a problem of digital roots. If you add up the base $10$ digits of the cube of a positive integer and keep adding them until it boils down to a single digit, you will get $1$, $8$ or $9$. So you need the digital root of $3n^2 + 3n$ to be $3$, $1$ or $2$. – David R. Apr 20 '16 at 22:38

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.

• I knew you'd spot that but probably didn't want to create an edit conflict. I'm done with this. Feel free to make more concise. – James47 Apr 22 '16 at 21:34

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$.

Hint: Look at the equation modulo $9$.

Details: First we observe that for any $m$, we have $m^3$ is congruent to one of $0$, $1$, or $-1$ modulo $9$. To do this, it is sufficient to find the cubes of $0,1,2,3,4$ modulo $9$, since $(-m)^3\equiv -m^3\pmod{9}$.

Now we calculate $n^2+n$ modulo $3$. It is easy to verify that $n^2+n$ is congruent to $0$ or $-1$ modulo $3$. If $n^2+n$ is divisible by $3$, then $3n^2+3n+7\equiv 7\pmod{9}$. And if $n^2+n\equiv -1\pmod{3}$, then $n^2+n$ is of the shape $3k-1$, and therefore $3n^2+3n+7$ is of the shape $9k+4$, so is congruent to $4$ modulo $9$.

Comparing, we find that $3n^2+3n+7$ can never be congruent to $m^3$ modulo $9$, and therefore the equation $3n^2+3n+7=m^3$ cannot have a solution in integers.

Remark: Studying a Diophantine equation modulo some $q$ can be a useful method to show the equation does not have a solution. However, finding the appropriate modulus can be difficult. In addition, the method need not work. There are Diophantine equations that have no integer solution, but have a solution modulo every $q$.

The modulus $9$ can be useful when we are dealing with cubics, since $x^3$ takes on very few values modulo $9$.

• why? what hints the hint? (magic solutions are not useful) – Rolazaro Azeveires Apr 22 '16 at 20:15
• @RolazaroAzeveires: When a Diophantine problem involves cubes, working with a modulus that gives a limited range of possibilities for the cube can be very useful. Any cube is congruent to $0$ or $\pm 1$ modulo $9$. Another modulus that is useful for cubes is $7$, for again all cubes are congruent to $0$ or $\pm 1$ modulo $7$. Indeed magic solutions can be of limited utility, but the idea here can be used elsewhere. – André Nicolas Apr 22 '16 at 20:38
• I have to agree with Ralozaro here. It's like when someone asks a question that involves a system of congruences and you respond with "Use the Chinese remainder theorem." – James47 Apr 22 '16 at 21:15
• Thank you for adding that remark, explaining why try modulo 9. That is the main thing in a good reply (I think). Not the solution itself, but why go that way. – Rolazaro Azeveires Apr 23 '16 at 12:02