Why is $\underbrace{444\dots44}_{2n} + \underbrace{888\dots88}_{n} + 4$ never a perfect square

elementary-number-theorysquare-numbers

In this question, the questioner asked to prove that $$f(n)=\underbrace{444\dots44}_{2n} + \underbrace{888\dots88}_{n} + 4$$ is a perfect square for all $n\in\mathbb N$. However, I was not able to find any $n$ for which this is true. So I have the following "counter-conjecture": For any $n\in\mathbb N=\{1,2,3,4,\dots\}$, $f(n)$ is not a perfect square.

How can I prove this?

Notice that by simply evaluating the geometric series we get $$f(n)=\frac{8}{9} \left(10^n-1\right)+\frac{4}{9} \left(10^{2 n}-1\right)+4=\frac{4}{9} \left(2^{n+1} 5^n+100^n+6\right),$$

so it would be enough to prove that $$\sqrt{f(n)}=\frac{2}{3} \sqrt{2^{n+1} 5^n+100^n+6}$$ is never an integer.

But I don't know how to do this.

Best Answer

For all naturals $n$ we have $$f(n+1)-f(n)=44\cdot10^{2n}+8\cdot{10^n}.$$

Hence, $$\frac{f(n+1)-f(n)}{16}=11\cdot25\cdot10^{2(n-1)}+5\cdot10^{n-1}\in\mathbb N.$$

It follows that $$f(n)\equiv f(1)\equiv8\pmod{16}$$ for all $n\in\mathbb N$.

Because every square is equivalent to $0,1,4$ or $9$ modulo $16$, it follows that $f(n)$ is never a square.

Related Question