# Solve $b^2 = 8b - 16a$ for $a,b\in\Bbb Z$

I want to know when the equation : $$b^2 = 8b - 16a$$ is true.

I wanted to create a polynom like this one : $$(b-4)^2 = 16(-a+1)$$ but then I don't know what to do. Any idea?

• We need $a+1$ to be a perfect square Nov 17, 2017 at 16:15
• I don't know why so many answer are setting the equation over $\mathbb{Z}$, he never said it was restricted to that set. Nov 17, 2017 at 16:27
• There is a tag diophantine equation. Nov 17, 2017 at 16:30

The equation is actually $$(b-4)^2=16(1-a)$$

Your LHS is a square number, your RHS is $16 x$ where $x$ is an integer. When can your RHS be made into a square number?

It already has $2^4=(2^2)^2$ as a factor, so all you need is for $x$ to be a square number.

So $x=1-a=n^2$ for $n\in \Bbb N$. Then $b-4=\pm4n$.

So solutions are $$a=1-n^2\\b=4\pm4n$$ $\forall n\in \Bbb N$.

• Surely $a$ could be negative? Or perhaps $a=1, b=4$... Nov 17, 2017 at 16:24
• @abiessu yes you're right, I had assumed it was $\Bbb N$ for some reason Nov 17, 2017 at 16:36

First we see that $8\mid b^2$ so $b=4c$ for some integer $c$. Thus we get $$c^2=2c-a\;\;\;\;\Longrightarrow \;\;\;\;c\mid a$$ So $a=cd$ for some integer $d$ and we have now $$c=2-d$$ So all solution are $(a,b)= (2d-d^2, 8-4d)$, where $d\in \mathbb{Z}$.

• (+1) for a different approach. I was worried mine was wrong, it took me a while to realise your answer is the same, just with $n\to d-1$ haha. Nov 17, 2017 at 16:47

You could just use the common second degree equation formula.

So:

$$b^2-8b+16a=0\implies b = \frac{8 \pm \sqrt{64-64a}}{2}$$

From this we can conclude that there will only exist a solution over $\mathbb{R}$ when $\sqrt{64-64a}$ exist. Is easy to check that the root only exists when the inside part is greater than 0, so $64-64a\geq 0 \implies 64\geq 64a\implies 1 \geq a$. So a can take any value from $(-\infty,1]$.

• This was tagged with diophantine equation, so $a,b\in\Bbb Z$. Your solution would give $b=4\pm 4\sqrt{1-a}$, having solutions in $\Bbb Z$ if $1-a$ is a perfect square. Continuing would give the same as my solution. Nov 17, 2017 at 16:42
• Ohh, okay, my bad, thanks Nov 17, 2017 at 16:43
• no thank you it is great :) another perspective is always something good Nov 17, 2017 at 16:49

we get $$(b-4)^2=16(1-a)$$ i hope this solves your problem