# Can $\,9\!\cdot\!10^n+4\,$ be a perfect square? [duplicate]

I think $$\,9\!\cdot\!10^n+4\,$$ can be a perfect square, since it is $$0 \pmod 4$$ (a quadratic residue modulo $$4$$), and $$1 \pmod 3$$ (also a quadratic residue modulo $$3$$).
But when I tried to find if $$\;9\!\cdot\!10^n+4\,$$ is a perfect square, I didn’t succeed. Can someone help me see if $$\;9\!\cdot\!10^n+4\,$$ can be a perfect square ?

• Jan 21, 2023 at 12:34
• I suggest: if $n=2k+1$ it looks like the square root is very close, but not equal to, to $9.5\times 10^k$. Start there. (Note: the problem is easy is $n$ is even. Why?)
– lulu
Jan 21, 2023 at 12:50
• @JustWandering Well, that's a standard Pell's equation. $(m,n)=(6,19)$ is a solution, for instance (there are infinitely many). Can you use that to address the OP's question?
– lulu
Jan 21, 2023 at 13:25
• @lulu, how have you found that solution ? Actually, there does not exist any solution. Jan 21, 2023 at 14:17
• Dupe of Prove nonsquare $111...161 = (10^k-1)/9+50$. You chose the wrong modulus to test. See this Hint in the dupe for how to choose it. Jan 22, 2023 at 0:01

If you reduce mod $$11$$ you get $$(-2)(-1)^n+4 \equiv 2$$ or $$6 \pmod{11}$$. Neither $$2$$ nor $$6$$ is a quadratic residue mod $$11$$.

• Wow, a nice solution ! (+1) Jan 21, 2023 at 13:36
• Congratulations ! I like your solution very much. Jan 21, 2023 at 14:15

Note that if $$9\!\cdot\!10^n+4=m^2\implies (m+2)(m-2)=9\!\cdot\!10^n$$

Note that $$5^n$$ must divide either $$m+2$$ or $$m-2$$. If that happens, the rest of the factors are not big enough to maintain the difference of $$4$$ as $$\left|5^n-9\!\cdot\!2^n\right|>4$$ for $$n\geqslant3$$.

Assume that $$9\cdot10^n+4\equiv4$$ is a perfect square.
$$9\cdot10^n+4\equiv4\pmod9$$, so $$9\cdot10^n+4$$ can be represented as $$(9m-2)^2=81m^2-18m+4$$ or $$(9m+2)^2=81m^2+18m+4$$, where $$m\in\mathbb{N}$$.
If $$9\cdot10^n+4=81m^2-18m+4$$, $$10^n=9m^2-2m=m(9m-2)$$ This means that $$m$$ and $$9m-2$$ must be powers of $$10$$.
Clearly, $$9m-2>m$$ because $$m>0$$. If $$m≠1$$, $$m\equiv0\pmod{10}$$, but then $$9m-2\equiv8\pmod{10}$$, which doesn't work. If $$m=1$$, $$9m-2=7$$, which also doesn't work.
If $$9\cdot10^n+4=81m^2+18m+4$$, $$10^n=9m^2+2m=m(9m-2)$$ This means that $$m$$ and $$9m+2$$ must be powers of $$10$$.
Clearly, $$9m+2>m$$ because $$m>0$$. If $$m≠1$$, $$m\equiv0\pmod{10}$$, but then $$9m+2\equiv2\pmod{10}$$, which doesn't work. If $$m=1$$, $$9m+2=11$$, which also doesn't work.
Therefore, there is a contradiction and so $$9\cdot10^n+4$$ cannot be a perfect square.

Comment:

Lets try construction such a number. Suppose we have:

$$k^2-9\times 10^n=4$$

We use following known Pell's equation:

$$x^2-Dy^1=1$$

For $$D=10$$ we have $$x=19$$ and $$y=6$$ such that:

$$19^2-10\times 6^2=1$$

multiplying both sides by $$2^2$$ we get"

$$38^2-10\times 12^2=4$$

we rewrite this as:

$$38^2-9\times(4^2\times 10)=4$$

multiplying both sides by $$25^2$$ we get:

$$(25\times 38)^2-9\times 10^5=4\times 25^2=2500=2496+4$$

Or:

$$[(25\times 38)^2-2496]-9\times 10^5=4$$

Or generally:

$$A=[(25\times 38)\times 10^m-(25\times 10^{2m}+96)]$$

here in equation $$k^2-9\times 10^n=4$$, $$n=2m+1$$

$$A$$ must be perfect square.May be by brute force we can find such a number.