# Is there a perfect square in the sequence $6, 96, 996, 9996, ... , 99999...996, ...$?

$$6, 96, 996, 9996,\dots, 99999\cdots996,\dots$$

Consider the above number sequence. Here in the $$n$$ $$^{th}$$ term $$n-1$$ digits are $$9$$. How can we tell about the existence of a perfect square number in this sequence?

• If the perfect square were $10^{2n}-4$, then its factors would be $10^n+2,10^n-2$. So the perfect square must be of the form $10^{2n-1}-4$. Mar 4, 2016 at 17:57

The sum of the digits of the $n^{th}$ term of this sequence is $$\text{Sum}=9(n-1)+6=9n-3=3(3n-1)$$ Thus, every number in the sequence is divisible by $3$ but not by $9$. Hence, no number in the sequence can be a perfect square.

HINT: consider divisibility by a suitable small number $n$ and also by $n^2$

Another method to approach this problem.

Using $$\pmod{11}$$:

• if the number of $$9’s$$ in $$\underbrace{99\cdots9}_{n\text{ times}}$$ is even, then the number will be divisible by $$11$$, so $$\underbrace{99\cdots9}_{n\text{ times}}6\equiv-3\equiv8\pmod{11}$$, if $$n$$ is odd.
• If $$n$$ is even, then $$11\mid\underbrace{99\cdots9}_{n\text{ times}}0$$, so $$\underbrace{99\cdots9}_{n\text{ times}}6\equiv6\pmod{11}$$ if $$n$$ is even.

But the quadratic residues $$\pmod{11} \in ({1, 3, 4, 5, 9})$$, and since $$\underbrace{99\cdots9}_{n\text{ times}}6$$ is always either equal to $$2$$ or $$6$$ $$\pmod{11}$$, then $$\underbrace{99\cdots9}_{n\text{ times}}6$$ will never be a perfect square.

Bonus:

• For any $$n\geq4$$, then $$\underbrace{99\cdots9}_{n\text{ times}}6$$ is equal to $$12\pmod{16}$$, as after dividing it by four, we will obtain $$24\underbrace{99\cdots9}_{n\text{ times}}$$, which is equal to $$3\pmod{4}$$ whenever $$n\geq2$$. This is a contradiction.
• In addition, if $$n$$ is even, then $$\underbrace{99\cdots9}_{n\text{ times}}6+4=10^{n+1}$$ is a perfect square, another contradiction to Catalan’s Conjecture. As an exercise, prove this.