Chinese New Year Equation 2016

In the spirit of Chinese New Year, here's a problem to commemorate the year.

$\color{black}{\text{Solve the following equation for positive integers$a$and$b$:}}$ $$\color{red}{a^2+b^2+(a+8)^2+(b+8)^2=100a+b}$$

Edit 1

As this question has been put on hold and the OP asked to improve the question by providing additional context", please find below some additional details.

Having read about Lagrange's four-square theorem and after some work, I noticed an interesting four-square combination for the year. Hence I thought I would formulate it as a problem - which turns out to be a diophantine equation - to see what different approaches there might be. A straightforward approach would be to rearrange the terms into a the standard circle formula $(a-21)^2+\left(b+\frac {15}4\right)^2=\left(\frac{\sqrt{6257}}4\right)^2\approx19.77^2$ and then testing integer values of $a$ within $21\pm 19.77$, but there should be other more interesting approaches.

Hopefully the explanation above will be sufficient for the question to be reopened. Moderators - please advise if there is additional context required. Thanks.

Edit 2

Thanks for the nice answers by Hagen and Daniel. The interesting point to note here is that:

$$\color{red}{20}^2+\color{red}{16}^2+(\color{red}{20}+8)^2+(\color{red}{16}+8)^2=\color{red}{2016}$$

$\color{black}{\text{To all readers who celebrate, a very Happy Chinese New Year!!}}$

Note: This question has been put on hold. If you find it interesting or useful, please vote to reopen it (by clicking on "reopen" at the bottom of this post), so that others can post their solutions. Thanks!

• Well, actually it was almost a week ago. But still cheers! – Vim Feb 13 '16 at 17:17
• – Watson Feb 13 '16 at 17:19
• @Watson: The colour was for festive purposes as this is a recreational-mathematics post. Anyway now edited so that only the equation is in festive red. Hopefully not too much inconvenience caused. – hypergeometric Feb 13 '16 at 17:33
• I agree this should be reopened. – fosho Feb 14 '16 at 11:15
• Elementary , my dear @Watson! :) – hypergeometric Feb 14 '16 at 13:58

First write it as $$(a-21)^2 +(b+\frac{15}{4})^2= \frac{6257}{16} = 1+\frac{79^2}{4^2}$$

$$\Rightarrow (a-21)^2-1 = \frac{79^2}{4^2}-(b+\frac{15}{4})^2$$

Now use difference of squares to get

$$(a-22)(a-20) = \bigg( \frac{4b+94}{4}\bigg)\bigg( \frac{64-4b}{4}\bigg)$$

We see we get corresponding positive integer solutions in $b$ for $a = 22$ and $a = 20$(since we only need one of the factors on the RHS to be $0$), namely $b = 16$.

Else we need RHS to be an integer (since the LHS clearly is), which will happen only when$$(4b+94)(64-4b) \equiv 0 \pmod{16}$$ $$\Rightarrow b = 18n$$

However it is easy to check that we get no new solutions from this. To see this write it as $$(a-21)^2 = \frac{6257}{16}-(18n+\frac{15}{4})^2$$

$$\color{red}{\text{Happy 2016!}}$$

• This is brilliant! Can you please elaborate on the "After some work" part? How did you arrive at the magical and neatly factorised form? – hypergeometric Feb 13 '16 at 18:12
• See the edited answer @hypergeometric. And happy New Year to you! :) – fosho Feb 13 '16 at 18:18
• How do you get from $(4b+94)(64-4b)\equiv 0\pmod{16}$ to $b=18n$? After all, already $b\equiv 0\pmod 2$ implies $(4b+94)(64-4b)\equiv 0\pmod{16}$ ... – Hagen von Eitzen Feb 14 '16 at 0:17
• Thanks for your additional explanation and your solution! Very neat factorisation! (+1) Happy 2016 to you too! – hypergeometric Feb 14 '16 at 6:46

The difference of the two sides (which must be $0$) equals $$\tag12(a-21)^2 +2(b-11)^2+59b-996\ge 59b-996$$ so that $b\le 16$. Also, the left hand side of $(1)$ is $\equiv b\pmod 2$, hence $b$ is even, $b=2c$ with $1\le c\le 8$. Substituting and dividing by $2$ we arrive at $$0=(a-21)^2+\underbrace{4c^2+15c-377}_{-358\,\ldots\,-1}$$ and check for which $c\in\{1,\ldots,8\}$ the number $377-4c^2-15c$ happens to be a perfect square. The only case is $c=8$ (so $b=16$) and leads to $a-21=\pm1$, i.e., $a=20$ or $a=22$.

• Thanks for your solution. By completing the square you get $2(a-21)^2$ but how did you arrive at $2(b-11)^2$ instead of $2(b+\frac{15}4)^2$? – hypergeometric Feb 13 '16 at 17:45
• Typo $15$ for $16$. – Brian Tung Feb 13 '16 at 18:03
• @hypergeometric Among all choices of "$b$ minus integer", this gave the best bound (i.e., $Ab-B$ with $B/A$ minimal). – Hagen von Eitzen Feb 14 '16 at 0:20
• Thanks for the explanation and your solution! (+1) – hypergeometric Feb 14 '16 at 6:45