# If $a^3+a^2+a=9b^3+b^2+b$ and $a,b$ are integers then show $a-b$ is a perfect cube.

If $a^3+a^2+a=9b^3+b^2+b$ and $a,b$ are integers then show $a-b$ is a perfect cube.

My attempt:I factorized it like below:

$(a-b)(a^2+b^2+ab+a+b+1)=8b^3=(2b)^3$

I take $gcd(a-b,a^2+b^2+ab+a+b+1)=d$

If $d=1$ then it is clear that $a-b$ is a perfect cube then consider $d>1$ then there is a $p$ that is prime and $p \mid d$.We have :

$p\mid a-b \Rightarrow p \mid (2b)^3 \Rightarrow p \mid 2b \Rightarrow p\mid 2$ or $p\mid b$

If $p\mid b$ then also $p\mid a$ (as $p\mid a-b$ holds). Then we will get to $p \mid 1$ because:

$p \mid a^2+b^2+ab+a+b,p \mid a^2+b^2+ab+a+b+1 \Rightarrow p \mid 1$

which is clearly wrong then we have $p\mid 2$ so $p=2$ means $d=2^k$ where $k$ is a natural number including $0$.In the case $d=1$ we have the right result.So assemble $k \ge 1$.Because $2 \mid a-b$ we can conclude that $a,b$ have the same parity @Ghartal showed in his answer that if $a,b$ are both even we have a right result but if $a,b$ are both odd we don't.So maybe we have to prove $a,b$ can,t be both odd.

• Isn't $(2b)^3=8b^3$ always a perfect cube? Apr 1, 2017 at 9:52
• @kingW3 It was a type mistake we should prove $a-b$ is a perfect cube. Apr 1, 2017 at 9:55
• Note that $$\gcd(a-b,a^2+b^2+ab+a+b+1)=\gcd(a-b,3b^2+2b+1)=d$$and if a prime $p$ divides $d$, then it divides $2b$. But if $p$ divides $b$, then it is contradiction because it should divide $3b^2+2b+1$ too and $\gcd(b,3b^2+2b+1)=1$. Therefore $p=2$ and $d$ is power of $2$. But I cannot prove $a-b$ is perfect cube... Apr 1, 2017 at 12:32
• @didgogns I showed the same thing in my answer. Apr 1, 2017 at 12:36
• I don't understand how $p|a$ or $p|2$ from $p|2b$. Apr 1, 2017 at 12:43

It turns out that there are only two rational solutions of $a^3+a^2+a = 9b^3+b^2+b$. One is the obvious integer solution $(a,b)=(0,0)$, for which $a-b$ is the cube $0$. The other is $(a,b) = (-7/5, -3/5)$, for which $a-b = -4/5$ is not a cube but $a,b$ are not integers. So $a-b$ is indeed a cube for all the integer solutions, as desired.

The proof that there are no other rational solutions is elementary, but requires Fermat's method of descent. The equation $a^3+a^2+a = 9b^3+b^2+b$ defines a smooth cubic curve with a rational point at $(a,b)=(0,0)$, so it's an elliptic curve that we can bring to standard form $y^2=\text{cubic}(x)$ by projecting from the origin.

Let $(a,b)$ be any rational solution other than $(0,0)$. Then $b\neq 0$ because the nonzero solutions of $a^3+a^2+a$ are not rational (or even real). Write $a=mb$ and divide by $b$ to get $$(9-m^3) b^2 + (1-m^2) b + (1-m) = 0.$$ This equation is quadratic in $b$, so it has rational solutions iff the discriminant is a square. The discriminant is $$-3 m^4 + 4 m^3 - 2 m^2 + 36 m - 35 = (1-m)(3m-7)(m^2+2m+5).$$ Taking $m=1$ yields $8b^2 = 0$, so we're back to the $b=0$ solution; and $m=7/3$ yields $-4(5b+3)^2/27 = 0$, so $b=-3/5$ and $a=-7/5$. We claim that there are no other solutions.

If $m\neq 1$ we may write $m = 1+(8/x)$ and calculate $$-3 m^4 + 4 m^3 - 2 m^2 + 36 m - 35 = \frac{2^8}{x^4} (x^3-2x^2-16x-48),$$ so we seek rational points on the elliptic curve $$y^2 = x^3-2x^2-16x-48 = (x-6)(x^2+4x+8)$$ other than the "point at infinity". The point $(x,y)=(6,0)$ brings us back to $m = 1 + (8/6) = 7/3$, and it turns out there are no others. Since the cubic on the right-hand side has a linear factor, we can try to prove this using Fermat's descent, which turns out to be enough. But these days there are other resources we can try first: Cremona's mwrank or the LMFDB, and either of these tells us that there are no other solutions and that Fermat-style descent suffices to prove it. In the case of mwrank we'd need a bit of additional computation to exclude other torsion points, so let's go the database route: enter the coefficients [0,-2,0,-16,-48] into the "curve, label or isogeny class label" search window for elliptic curves over $\bf Q$, and find the entry for this curve of conductor 544 (which is small enough that it's also in Cremona's book). We find that the curve has only the known two torsion points and rank zero, and moreover that the 2-part of the Tate-Shafarevich group is trivial, so a 2-descent suffices to establish rank zero. This completes the proof.

Note: This is not a complete solution. It may give others some clues.

We have that $$(a-b)(a^2+b^2+ab+a+b+1)=8b^3 \tag{1}$$ Let

$$d=\gcd(a-b, a^2+b^2+ab+a+b+1).$$

And let $p$ be an odd prime divisor of $d$. Then $p \mid a-b$ and $p \mid b$. It follows that $p|a$. Since $p \mid a^2+b^2+ab+a+b+1$ we get $p \mid 1$. Contradiction. Thus only prime divisor of $d$ is $2$.

From equation $(1)$ observe that $a$ and $b$ have the same parity. Thus $a-b$ is even. So let $a-b=c=2^k (2l+1)$, where $l$ is an integer. Equation $(1)$ becomes.

$$c(3b^2+c^2+3bc+2b+c+1)=8b^3 \tag{2}$$

Notice that if $b$ is an even number then $3b^2+c^2+3bc+2b+c+1$ will be odd. Hence

$$d=\gcd\big(c, 3b^2+c^2+3bc+2b+c+1\big)=1.$$ And $c$ is a perfect cube. Now, suppose that $b$ is odd. Then, since $3b^2+1 \equiv 0 \pmod{4}$ we get $$3b^2+c^2+3bc+2b+c+1=3b^2+1+c(c+1+3b)+2b \\ =4m+2b=2(2m+b)$$Thus the highest power of $2$ dividing LHS of equation $(2)$ is $k+1$. And since $v_2($RHS$)=3$ we get that $k=2$. Thus $a-b=4(2l+1)$ cannot be a cube.

Maybe in this case there is no solution for the equation at all.

• But $8l+4$ can be a cube of $8k+2$? Jun 6, 2017 at 6:39
• Let $4(2l+1)=j^3$. then $j$ is even and $$4(2l+1)=8j'^3$$ or $$2l+1=2j'^3,$$which is not possible. Thus $4(2l+1)$ cannot be a cube. Jun 6, 2017 at 8:38
• I think your answer is complete.What is it missing? Jun 6, 2017 at 9:01
• Well , the question says prove that $a-b$ is a perfect cube. But I have shown that in some cases It cannot be a cube! And actually we don't know yet that if there are some solutions in later case or not! Jun 6, 2017 at 9:07
• It gives us the idea to show that there are no solutions in that case +1. Jun 6, 2017 at 9:47

If $a-b=0\Longrightarrow b=0$ and $a-b$ is a perfect cube.
Also $a=0\Longleftrightarrow b=0$ and $a-b$ is a perfect cube.

Assume $a-b\ne0~\wedge~a\ne0~\wedge~b\ne0$.

Let's factorize $a^3+a^2+a=9b^3+b^2+b$.
$\begin{array}{rrcl} & (a^3-b^3)+(a^2-b^2)+(a-b) & = & 8b^3\\ \Longrightarrow & (a-b)(a^2+ab+b^2)+(a-b)(a+b)+(a-b) & = & 8b^3\\ \Longrightarrow & (a-b)(a^2+b^2+ab+a+b+1) & = & (2b)^3\\ \Longrightarrow & (a-b)\big(a^2+b^2+a(b+1)+(b+1)\big) & = & (2b)^3\\ \Longrightarrow & \underbrace{(a-b)}_X\underbrace{\big(a^2+b^2+(a+1)(b+1)\big)}_Y & = & (2b)^3 \end{array}$

Define $d=\gcd(X,Y)$.
Suppose $d>1\Longrightarrow\exists p\in\mathbb{N}:p\mid d$ and $p$ is prime.
Suppose $p>2\Longrightarrow p\mid X\Longrightarrow p\mid8b^3\Longrightarrow p\mid b^3\Longrightarrow p\mid b$.
Then $p\mid X~\wedge~p\mid b\Longrightarrow p\mid a\Longrightarrow p\mid a^2~\wedge~p\mid b^2$.
Then $p\mid Y~\wedge~p\mid(Y-1)\Longrightarrow p\mid1$.
Contradiction because $p>1\Longrightarrow p=2~\vee~d=1$.

If $a$ and $b$ are either both even neither both odd, then $X$ is odd and $a^2+b^2$ is odd and $(a+1)(b+1)$ is even, then $Y$ is odd so $2\nmid d$, and that's a contradiction because $8\mid XY$.

So $a$ and $b$ have the same parity, then $2\mid X$.

Suppose both $a$ and $b$ are even, then $a^2+b^2$ is even and $(a+1)(b+1)$ is odd, then $Y$ is odd. So $\gcd(X,Y)=1$, then $a-b$ is a perfect cube (it's easy to prove it).

Suppose both $a$ and $b$ are odd, then $\gcd(X,Y)=2$.
Also $\gcd(X,b)=1$, since $X\mid8b^3\Longrightarrow X\mid8\Longrightarrow8\le|X|\le8$.
But $|X|\ne8$ otherwise $Y\mid b^3$ but $2\mid Y\Longrightarrow2\mid b$.
Contradiction because $2\nmid b\Longrightarrow|X|=2~\wedge~|X|=4$.

Note: From now, the exercise contains a lot of work of pick & spade.

Since $\gcd(X,b)=\gcd(a-b,b)=1\Longrightarrow\gcd(a,b)=1$ (It's easy to prove it). We have $a^3+a^2+a=9b^3+b^2+b\Longrightarrow a(\underbrace{a^2+a+1}_A)=b(\underbrace{9b^2+b+1}_B)$
Then $a\mid B~\wedge~b\mid A$.
Let's define $f(x)=x^3+x^2+x$ and $g(x)=9x^3+x^2+x$, so we need $f(a)=g(b)$.

• First case: $a-b=2\Longrightarrow a=b+2~\wedge~b=a-2$.
$\begin{array}{rclcl} A & = & a^2+a+1 & & \\ & = & (b+2)^2+(b+2)+1 & & \\ & = & b^2+4b+4+b+2+1 & & \\ & = & b^2+5b+7 & \Longrightarrow & b=\pm1~\vee~b=\pm7\\ B & = & 9b^2+b+1\\ & = & 9(a-2)^2+(a-2)+1\\ & = & 9a^2-36a+36+a-2+1\\ & = & 9a^2-35a+35 & \Longrightarrow & a=\pm1~\vee~a=\pm5~\vee~a=\pm7~\vee~a=\pm35 \end{array}$
Here are only two possible solutions $(a,b)\in\left\{(1,-1),(-5,-7)\right\}$.
But there are no solutions for this case because $\forall a,b:f(a)\ne g(b)$.
• Second case: $a-b=-2\Longrightarrow a=b-2~\wedge~b=a+2$.
$\begin{array}{rclcl} A & = & a^2+a+1 & & \\ & = & (b-2)^2+(b-2)+1 & & \\ & = & b^2-4b+4+b-2+1 & & \\ & = & b^2-3b+3 & \Longrightarrow & b=\pm1~\vee~b=\pm3\\ B & = & 9b^2+b+1\\ & = & 9(a+2)^2+(a+2)+1\\ & = & 9a^2+36a+36+a+2+1\\ & = & 9a^2+37a+39 & \Longrightarrow & a=\pm1~\vee~a=\pm3~\vee~a=\pm13~\vee~a=\pm39 \end{array}$
Here are only three possible solutions $(a,b)\in\left\{(-1,1),(1,3),(-3,-1)\right\}$.
But there are no solutions for this case because $\forall a,b:f(a)\ne g(b)$.
• Third case: $a-b=4\Longrightarrow a=b+4~\wedge~b=a-4$.
$\begin{array}{rclcl} A & = & a^2+a+1 & & \\ & = & (b+4)^2+(b+4)+1 & & \\ & = & b^2+8b+16+b+4+1 & & \\ & = & b^2+9b+21 & \Longrightarrow & b=\pm1~\vee~b=\pm3~\vee~b=\pm7~\vee~b=\pm21\\ B & = & 9b^2+b+1\\ & = & 9(a-4)^2+(a-4)+1\\ & = & 9a^2-72a+144+a-4+1\\ & = & 9a^2-71a+141 & \Longrightarrow & a=\pm1~\vee~a=\pm3~\vee~a=\pm47~\vee~a=\pm141 \end{array}$
Here are only three possible solutions $(a,b)\in\left\{(1,-3),(3,-1),(-3,-7)\right\}$.
But there are no solutions for this case because $\forall a,b:f(a)\ne g(b)$.
• Fourth case: $a-b=-4\Longrightarrow a=b-4~\wedge~b=a+4$.
$\begin{array}{rclcl} A & = & a^2+a+1 & & \\ & = & (b-4)^2+(b-4)+1 & & \\ & = & b^2-8b+16+b-4+1 & & \\ & = & b^2-7b+13 & \Longrightarrow & b=\pm1~\vee~b=\pm13\\ B & = & 9b^2+b+1\\ & = & 9(a+4)^2+(a+4)+1\\ & = & 9a^2+72a+144+a+4+1\\ & = & 9a^2+73a+149 & \Longrightarrow & a=\pm1~\vee~a=\pm141 \end{array}$
Here are no possible solutions $(a,b)\in\left\{\right\}$.
But there are no solutions for this case because $\forall a,b:f(a)\ne g(b)$.

So it is proved.

PD: also I think $a=b=0$ is the unique (integer) solution for this equation, but I haven't proved this, what I proved is $a-b$ is a perfect cube and both $a$ and $b$ are even for all solutions to this equation.

• How do you conclude that $gcd(X,b)=1$? Jun 6, 2017 at 19:34

Revised proof:

We have $(a-b)(a^2 + b^2 + ab + a + b + 1) = (2b)^3$

From OP, we see that if $p$ divides $d$ then $p$ divides $2b \implies p \mid 2$ or $p \mid b$.

Assume $p$ doesn't divide $2$.

$p \mid b \implies p \mid a$ but then $p$ does not divide $a^2+b^2+ab +a+b+1$.

Therefore $p=1$ or $p=2$. If $p=1$ then $a-b$ is a cube.

If $p=2$ then since $p$ does not divide $b$ both $a$ and $b$ are odd.

Now $a^2 + b^2 + ab + a + b + 1 \ne 0 \mod 4$. Therefore largest power of $2$ in $a^2 + b^2 + ab + a + b + 1$ is $2$.

Largest power of $2$ in $a-b$ should be $4$ (as $b$ is odd)

So one possibility is $a-b = 4m^3$ and $a^2 + b^2 + ab + a + b + 1 = 2n^3$ where $b = mn$

I guess I am stuck at this point.

• If $a,b$ are odd, how do you get that $a-b=8$? Apr 2, 2017 at 2:14
• if $a,b$ are odd, then $d$ is a multiple of $2$. $a-b$ divides $8b^3$ and since $a-b$ and $b$ cannot have a common prime factor, $a-b = 8$.
– sku
Apr 2, 2017 at 2:20
• Can't $a-b$ be $2$ or $4$? Apr 2, 2017 at 2:28
• @sku How do you prove that $a=b=0$ is the only solution. Jun 5, 2017 at 7:55
• I added a new proof.
– sku
Jun 5, 2017 at 13:01

Let us consider the Diophantine equation $$(a-b)(a^2+ab+b^2+a+b+1) = 8b^3.\tag1$$ Let $\ \gcd(a,b) = d.$

$\text{If }\mathbf {d > 1,}\text{ then }a=md,\quad b=nd,\quad \gcd(m,n) = 1,$ $$(m-n)\left((m^2+mn+n^2)d^2 + (m+n)d + 1\right) = 8d^2n^3.\tag2$$ ${\text{If }\mathbf{2\mid d},\ \text{then}}$ $$2\mid m-n,\quad 2\nmid (m^2+mn+n^2)d^2 + (m+n)d + 1,$$ $$d\mid m-n,\quad \gcd(d, m^2+mn+n^2)d^2 + (m+n)d + 1) = 1,$$ so $$m-n=\pm8d^2,\quad (m^2+mn+n^2)d^2 + (m+n)d + 1 = \pm n^3,$$ $$a-b = \pm8d^3 = (\pm2d)^3.$$

$\text{If }\mathbf {(d > 2)\wedge (d\nmid2),}\text{ then the case } (2\nmid m+n)\text{ contradicts with (2), so }$ $$2\nmid m,\quad 2\nmid n,\quad (m-n=\pm 2d^2) \vee (m-n = \pm4d^2),$$ \left[\begin{align} &\begin{cases} m = n\pm2d^2\\ 4d^6 - 3d^2n(n\pm2d^2) + 2d(n\pm d^2) + 1 = \pm4n^3 \end{cases}\\ &\begin{cases} m = n\pm4d^2\\ 16d^6 - 3d^2n(n\pm4d^2) + 2d(n\pm2d^3) + 1 = \pm2n^3, \end{cases} \end{align}\right. \left[\begin{align} &\begin{cases} m = n\pm2d^2\\ \mp4n^3 - 3d^2n^2 + 2d(1\mp3d^3)n + 4d^6 \pm2d^3 + 1 = 0 \end{cases}\\ &\begin{cases} m = n\pm4d^2\\ \mp2n^3 - 3d^2n^2 + 2d(1\mp6d^2)n + 16d^6 \pm4d^3 + 1 = 0, \end{cases} \end{align}\right. and both of systems leads to the same equation without solutions $$d^2n^2+1\equiv0\pmod4.$$

$\text{If }\mathbf {d = 1,}\text{ then the proof of the previous case is valid. Solutions also do not.}$

Thus, the issue equation has the integer solutions only in the case $\mathbf{2\nmid \gcd(a,b)},$
when $\mathbf{a-b}\$ is a perfect cube.

• How do you conclude that $m-n=8d^2$? Jun 10, 2017 at 6:41
• @TahaAkbari Fixed and improved, thanks. Jun 10, 2017 at 10:34
• In the case$m-n=\pm 2d^2$ I got $d^2n^2 \pmod 1 (mod 4)$ not what you've written. Jul 1, 2017 at 7:11
• But the case $m-n=2d^2$ doesn't lead to that. Jul 4, 2017 at 5:35