# Find b such that $(a+b)^3 - a^3=2007h$

Find all $b$ such that $(a+b)^3 - a^3$ divisible $2007\ (a,b \in \mathbb{Z})$

I can solve for $b$: $(a+b)^3 - a^3=2007h \rightarrow b=\sqrt[3]{a^3+2007h}-a$

-
It might be more useful to think of this as $(a+b)^3-a^3=0$ mod $2007$. – Eric Stucky Dec 21 '12 at 9:27
Integer multiples of $b:=2007$ are solutions, Integer multiples of $b:=669$ are solutions. Could be more. – Rustyn Dec 21 '12 at 9:49
Also note that $2007 = 3^2 \times 223$, where $223$ is a prime. – Robert Israel Dec 21 '12 at 9:49
and that $(a+b)^3 - a^3 = b (3 a^2 + 3 a b + b^2)$. – Robert Israel Dec 21 '12 at 9:53
– lab bhattacharjee Dec 21 '12 at 16:19

$2007=9\cdot223$

So, $9\mid(b^3+3a^2b+3ab^2)\implies 3\mid b,b=3c$(say)

$(a+3c)^3-a^3=9c(a^2+3ac+3c^2)$

$9\cdot223 \mid 9c(a^2+3ac+3c^2)$

or $223 \mid c(a^2+3ac+3c^2)$

So, either $(i)223\mid c$

or, $(ii)223 \mid (a^2+3ac+3c^2)\iff 223\mid 4(a^2+3ac+3c^2)$

But, $4(a^2+3ac+3c^2)=(2a+c)^2+3c^2$

So, $(\frac{2a+3c}c)^2\equiv-3\pmod{223}$ (assuming $(c,223)=1\implies (a,223)=1$)

So, we need to check if $-3$ is a quadratic residue of $223$

Using the law of quadratic reciprocity, $\left(\frac3{223}\right)\left(\frac{223}3\right)=(-1)^{\frac{(223-1)(3-1)}4}=-1$ $\implies \left(\frac3{223}\right)=-\left(\frac{223}3\right)$

But $\left(\frac{223}3\right)=\left(\frac13\right)=1$ So, $\left(\frac3{223}\right)=-1$ and as $223\equiv-1\pmod 4, \left(\frac{-1}{223}\right)=-1$

So, $\left(\frac{-3}{223}\right)=\left(\frac3{223}\right)\left(\frac{-1}{223}\right)=1$

Hence, we have two more in-congruent solutions$\pmod{223}$.

By brute force, $79^2\equiv-3\pmod{223}\implies \left(\frac{2a+3c}c\right)^2\equiv 79^2$

So, $\left(\frac{2a+3c}c\right)\equiv \pm 79\implies a\equiv-41c,38c \pmod{223}$

So, we need to find $(-41)^{-1},(38)^{-1}\pmod{223}$

$$\frac{223}{38}=5+\frac{33}{38}=5+\frac1{\frac{38}{33}}=5+\frac1{1+\frac5{33}} =5+\frac1{1+\frac1{\frac{33}5}}=5+\frac1{1+\frac1{6+\frac 35}} =5+\frac1{1+\frac1{6+\frac1{\frac53}}}=5+\frac1{1+\frac1{6+\frac1{1+\frac23}}} =5+\frac1{1+\frac1{6+\frac1{1+\frac1{\frac32}}}}=5+\frac1{1+\frac1{6+\frac1{1+\frac1{1+\frac12}}}}$$

So, the last but one convergent is $$5+\frac1{1+\frac1{6+\frac1{1+\frac1{1}}}}=\frac{88}{15}$$

So, using the convergent property of continued fraction, $223\cdot15-38\cdot88=1\implies (38)^{-1}\equiv -88\pmod{223}\equiv (223-88)=135$

So, $c\equiv (38)^{-1}a\pmod{223}\equiv 135a$

$(-41)^{-1}$ can be calculated similarly.

-