# Find the natural solutions of $a^3-b^3=999$

I want to find the natural solutions of $a^3-b^3=999$.

I got $a^3-b^3=(a-b)\cdot(a^2+ab+b^2)$, so if we consider the equation in $\mathbb{Z}/3\mathbb{Z}$ we get

$$(a-b)\cdot(a^2+ab+b^2) \equiv0 \text{ mod }3$$ and because $\mathbb{Z}/3\mathbb{Z}$ is a domain, we get $$a\equiv b \text{ mod } 3 \text{ or } a^2+ab+b^2\equiv0 \text{ mod } 3.$$ Besides, the prime factorization of $999=3^3\cdot37$, but I don't know how to go on.

I would appreciate any hints.

• The prime factorization is a good start. Try setting up a system of equations for $a$ and $b$ given any particular factorization, i.e. for example $(a - b)(a^2 + ab + b^2) = 27 \cdot 37$, so that $a - b = 27$ and $a^2 + ab + b^2 = 37$. – Tob Ernack Feb 3 '18 at 19:39

By Fermat Little Theorem $$x^3 \equiv x \pmod{3}$$

Therefore $$0 \equiv a^3-b^3 \equiv a-b \pmod{3}$$

This shows that $a-b=3k$.

Then $$3^3 \cdot 37 =a^3-b^3=(a-b)(a^2+ab+b^2)=(a-b)((a-b)^3+3ab)=3k(9k^2+3ab) \Rightarrow \\ 3 \cdot 37=k(3k^2+ab)$$

Since $k <3k^2+ab$ the only posibilities are $$k=1 \\ 3k^2+ab=3 \cdot 37$$ or $$k=3 \\ 3k^2+ab= 37$$

This leads to $$a-b=3k=3 \\ ab=108$$ or $$a-b=9 \\ ab=10$$ which are easy to solve.

You have $(a-b)(a^2+ab+b^2)=999$, so $a-b$ is a factor of $999$, that is one of $1,3,9,27,37,111,333$ and $999$ and $a^2+ab+b^2$ is the complementary factor. There are now eight cases. If $a-b=1$, then $a=b+1$ and $999=a^2+ab+b^2=3b^2+3b+1$. This is a quadratic equation; has it any integer solution? Once this is decided, seven more cases to go!

• +1, but I have a so faster method :) – Zaharyas Feb 3 '18 at 20:05

$$999=a^3-b^3=(a-b)^3+3ab(a-b)\geq(a-b)^3,$$ which says $a-b$ is divided by $3$ and $a-b\leq9$ and we get not so many cases:

$a-b=3$ or $a-b=9$.

• Why do not you improve the answer? I think, People did not upvote because they did not understand.(+1) – MathLover Feb 3 '18 at 20:41
• But I explained all... What do you think is not clear? Thank you! – Michael Rozenberg Feb 3 '18 at 20:45
• For example, why $a-b≤9$. (I know reason). I think, impove answer and then write direct what is $a$ and $b$. Sincerely. – MathLover Feb 3 '18 at 20:49
• I added. See now. – Michael Rozenberg Feb 3 '18 at 20:55
• Your method is the fastest. And If you have to wrote the prices of $a$ and $b$ (at first), at least +10 you got. Sincerely! – MathLover Feb 3 '18 at 21:08

So $(a-b)(a^2 + ab + b^2) = 3^3*37$

So $(a-b)|3^3*37$.

So $a-b = 3^j*37^k$ where $j = 0,1,2,3$ and $k=0,1$

And $(a^2 + ab +b^2) = \frac {3^3*27}{a-b} = 3^{3-j}*37^{1-k}$

That's 8 possible systems of equation.

But there are some obvious things to note.

If $37|a-b$ then $a - b \ge 37$ and ... that just seems wrong.

That means $a \ge 37$ and $a^2 + ab + b^2 > 37^2$ but if $37|a+b$ then the very largest that $a^2 + ab + b^2$ can be is $\frac {999}{37} = 27$.

So $37\not \mid a-b$ and $37|a^2 + ab + b^2$.

So $a-b = 3^k; k\le 3; a^2 +ab + b^2 = 3^{3-k}*37$

And there are only 4 systems of equations.

Likewise if $27|a-b$ then $a \ge 27$ and $a^2 + ab + b^2 > 27^2 > 37$ so that's not possible.

So $a-b = 3^k; k\le 2; a^2 + ab + b^2 = 3^{3-k}*37$.

And there are only 3 systems of equations.

$k = 0,1,2$.

If $k = 0$ we have $a= b+ 1$ and $(b+1)^2 + b(b+1) + b^2 = 999$

or $3b^2 + 3b + 1 = 999$ which isn't possible as LHS and RHS are not equivalent mod $3$.

If $k = 1$ we have $a = b+3$ and $(b + 3)^2 + b(b+3)+b^2 = 333$ and

$3b^2 + 9b + 9 = 333$ or

$b^2 + 3b - 108 = 0$ so $b = \frac {-3 +\sqrt {9+432}}2 = \frac {-3 + 21}2 = 9$ and $a = 12$

If $k = 2$ we have $a = b+9$ and $(b+9)^2 + b(b+9) + b^2 = 111$

$3b^2 + 27b + 81 = 111$

$b^2 + 9b + 27 = 37$

$b^2 + 9 - 10 = 0$

$(b+10)(b - 1) = 0$ so $b = 1$ and $a=10$.