# When is $999\cdots$ a perfect square?

I'm interesting to look more about property of this number $999\cdots$ , for even digits which form that number it's clear that's not a perfect square for example :$99=10^2-1,9999=10^4-1,\cdots$ , Now my question is: what about if the numbers of digits of $999\cdots$ is odd ? how i proof or disproof that is a perfect square or nor ?

Note: The trivial case is for $n=1$ which is $9$

• An odd perfect square is always 1 mod 4. Commented Aug 31, 2018 at 13:01
• @JohnBrevik Why are you answering in a comment? Commented Aug 31, 2018 at 13:04
• @Arthur I thought it would be helpful. Commented Aug 31, 2018 at 13:05
• @JohnBrevik Sure. It is, however, more helpful if you put it in an answer post. That's what they're there for, after all. Commented Aug 31, 2018 at 13:27
• We know now that no perfect square can end in two or more nines. But, using a slight modification, $...99969$ will occur at the end of perfect squares no matter how many nines are placed before the $69$. Commented Aug 31, 2018 at 21:12

Write: $$10^{2n+1}-1 = a^2$$

so $a=2k+1$ and now we have $$2^{2n+1}5^{2n+1}= 2\underbrace{(2k^2+ 2k+1)}_{\rm odd}$$

so $2^{2n+1}=2$ and thus $n=0$. Finally we have $9 = a^2$ so $a=3$.

The only number consisting entirely of nines that's a perfect square is $9$ itself.

Suppose $999$ were a perfect square. It would have the form $(2n+1)^2$ with$n$ a whole number. Therefore

$(2n+1)^2=4n^2+4n+1=999$

$4n(n+1)=998$

So $998$ has to be a multiple of $4$, but that doesn't work because the last two digits $98$ would have to be a multiple of $4$ and they aren't really so. So, the second equation above has no whole number solutions, the first equation can't have any such solutions either and $999$ fails to be a perfect square.

The same thing happens with any number ending with $99$, since the last two digits are what ultimately decides what can be a multiple of $4$. Once we have two nines at the end, therefore, there can never be a perfect square.

Any odd perfect square is of form $4k+1$ for some $k$. Now let $$a^2=10^{n}-1$$if $n\ge 2$ we have $$a^2=10^2\cdot10^{n-2}-1=4k-1$$which can't be a perfect square. So the only perfect square may be among those numbers with $$0\le n<2$$or $$0,9$$which are the only solutions.

• Odd squares are of the form $4k+1$, so you just need to consider $n\ge2$ or $n<2$. Commented Aug 31, 2018 at 14:40

To make $\underbrace{999\cdots 9}_{n\text{ many}}$ a perfect square, we need $9\cdot\underbrace{111\cdots 1}_{n\text{ many}}$ a perfect square. As, $9$ is already a perfect square, we need $\underbrace{111\cdots 1}_{n\text{ many}}$ to be a perfect square. But, observe that, $$11\equiv 3\pmod{4}\\ 111\equiv 3\pmod{4} \\ 1111\equiv 3\pmod{4}$$ in general, $$\underbrace{111\cdots 1}_{n\text{ many}}=2\underbrace{77\cdots 7}_{n-2\text{ many}}×4+3\equiv 3\pmod{4}$$

But, any odd perfect square can be of the form $4k+1$. Hence, none of the numbers is a perfect square.

Write the number from the form $$a=\underset{n}{\overline{\underbrace{9999...9}}_{10}}=10^{n}-1$$
a perfect square$$\Rightarrow a=k^{2}\Rightarrow 10^{n}-1=k^{2}\ \Rightarrow 10^{n}=k^{2}+1$$
Our $$(k^{2}+1)$$ is not a perfect square because it is sandwiched between the squares of two consecutive numbers $$k^{2}$$ and $$(k+1)^{2}$$ Which $$k^{2}\lt k^{2}+1\lt (k+1)^{2}$$
$$k^{2}\lt 10^{n}\lt (k+1)^{2}$$
For $$a$$ to be a perfect square, $$10^{n}$$ must not be a perfect square and be in the form of $$k^{2}+1$$
We study two cases (even and odd) $$n=2\lambda,n=2\lambda+1:\lambda\in N$$
1) $$n=2\lambda\to 10^{n}=\left( 10^{\lambda} \right)^{2}$$ This does not fulfill the condition $$k^{2}\lt 10^{n}\lt (k+1)^{2}$$(There is no perfect square between the )
2)$$n=2\lambda+1\Rightarrow k^{2}\lt 10^{2\lambda+1}\lt (k+1)^{2}$$
$$3^{2}\lt 10\lt 4^{2}\to 3^{2}.10^{2\lambda}\lt 10^{2\lambda+1}\lt 4^{2}.10^{2\lambda}$$
$$\left( 3\times 10^{\lambda} \right)^{2}\lt10^{2\lambda+1}\lt \left( 4\times 10^{\lambda} \right)^{2}$$
$$k^{2}\lt 10^{2\lambda+1}\lt (k+1)^{2}$$
$$k=3\times 10^{\lambda},k+1=4\times 10^{\lambda}\Rightarrow 3\times 10^{\lambda}+1=4\times 10^{\lambda}$$
$$\to 10^{\lambda}=1\Rightarrow \lambda=0$$
$$(\lambda=0)\to a=10^{n}-1=10^{2\lambda+1}-1=10-1=9$$
Abstract / The number $$999\cdots$$ It is impossible to be a perfect square if the number of its digits is an even number, and it can be a perfect square in the case of the number of its digits being odd in one case, which is the number is $$9$$

• i fixed some of your latex errors Commented Aug 8, 2022 at 20:39

Any number that is a square, and does have more then one digit, consists of at least one even digit.

So a square can not have only odd digits.

With other words $$999\dotso$$ can not be a square.

• You may need to leave this as a long comment Commented Aug 8, 2022 at 21:02
• @zeraouliarafik I posted it as an answer, because all the other answers, are kinda "complicated", while there is a simple observation, that answers the question immediatly and is more or less widely applyable. Commented Aug 8, 2022 at 21:09