$N$ is not a perfect square

199 Views Asked by At

Prove that the number $N:=a\cdot \overline{aa}\cdot \overline{aaa}\cdot \dots \cdot\overline{aaa\dots a}$ is not a perfect square, where $a$ is a nonzero number, $\overline{aaa...a}$ contains $n$ digits in base ten, $n\ge 2$.

Attempt: If $n=2k$, $11\cdot111\cdot....\cdot111...1=4t+3$, not a perfect square, then $N$ is not a perfect square.

3

There are 3 best solutions below

4
On

Noticing that $n$ is even implies the product cannot be a square is half the battle.

Notice further that $1111=11\cdot 101$, and $101$ is a prime number. Working $\bmod 101$, it is readily demonstrated that the residues of strings of $1$s from $4$ longer are $0,1,11,10,0,1,11,10,\dots$. That is, a factor of $101$ occurs once every four units, and an even number of factors of $101$ will occur once every $8$ units.

Revised answer: Thus, for the product to be a square, the value of $n$ must contain an even number of groups of $4$, or $8k+j$ units where $j=1,3$. $j\ne 0,2$ because if $n$ is even, OP has already shown that the product is not a square.

The $n$ odd case is addressed by essentially the same method given in the answer of Sahaj (credit where credit is due), except where he considers all odd integers $n=2k+1$, here I need only consider odd integers $n=8k+(1,3)$. Using his notation $K\equiv 1\cdot 3\cdot 7^{8k\pm 1} \equiv 5 \bmod 8$, and is not a square.

What might $a$ be? $K$ is odd and has no factors of $2$; if $a$ is even, it must contain an even number of factors of $2$ when raised to an odd power. Thus, if $a$ is even, it is $4$. oreover, assigning $a=1$ leaves us with $K$ itself (a non-square), so $a\in\{3,4,5,7,9\}$.

For any odd $n$, working $\bmod 8$, $3^n\equiv 3, 4^n \equiv 0, 5^n \equiv 5, 7^n \equiv -1, 9^n \equiv 1$, meaning $3^nK \equiv -1, 4^nK \equiv 0, 5^nK \equiv 1, 7^nK \equiv 3, 9^nK \equiv 5$. This reduces the possibilities to $a\in\{4,5\}$. For $a=4$, $a^n$ contains only factors of $2$, so it is apparent that $K$ must be a square itself, which it is not. If $a=5$, then $a^n$ contains an odd number of factors of $5$, so $K$ also must contain an odd number of factors of $5$, but by inspection it contains no factors of $5$.

1
On

For $n$ even you have already shown that $N$ is never a perfect square. Now we can show it for odd $n$.

Consider $K = 1\cdot 11\cdot 111\cdots\underbrace{111\dots111}_{2k+1 \text{ times}}$.

It is useful to note that $\bmod 8: \overline{a_na_{n-1}\dots a_3a_2a_1} \equiv \overline{a_3a_2a_1}$, so that

$\bmod 8: K \equiv 1\cdot 3\cdot 7^{2k-1} \equiv 3\cdot -1 \equiv -3 \equiv 5$. But, $5$ is never a quadratic residue $\bmod 8$. In particular that means $K$ is not a perfect square. This doesn't hold for $k<1$ ie $n=1$, in which case $1$ is indeed a perfect square. But I don't think that's allowed here.

Now, we consider $N=a^{2k}\cdot a\cdot K$. We know that $a \in \{1,2,3,4,5,6,7,8,9\}$. Now consider $\bmod 8: a\cdot K \equiv 5 \lor 2 \lor 7 \lor 4 \lor 1 \lor 6 \lor 3 \lor 0 \lor 5$. But $0$, $1$ and $4$ are quadratic residues $\bmod 8$.

So we just have to establish that $N$ is not a perfect square for $a \in \{4,5,8\}$. For $a=4$, we can just write it down as $a = 2^2$, put that $2^2$ factor into the perfect square and deal with whether $K$ is a perfect square or not, which it isn't. Similarly for $a=8$. For $a=5$, we know that $a\cdot K$ is not a perfect square since $5 \nmid K$ as no term ends with $5$.

0
On

Let $n\geq2$ be an integer and suppose your integer $N$ is a perfect square, which is $$N=\prod_{i=1}^na\cdot\frac{10^i-1}{9}=a^n\prod_{i=1}^n\frac{10^i-1}{9}.$$ Because $9=3^2$ is a perfect square, this is a perfect square if and only if $a^n\prod_{i=1}^n(10^i-1)$ is a perfect square.

If $n$ is even then $a^n$ is a perfect square, and so the remaining factor is also a perfect square. But $$\prod_{i=1}^n(10^i-1)\equiv1\cdot3\cdot7^{n-2}\equiv3\pmod{8},$$ where of course $3$ is not a quadratic residue mod $8$, a contradiction.

If $n$ is odd then $a^{n-1}$ is a perfect square, and writing $a=b^2c$ with $c$ squarefree we see that $$c\prod_{i=1}^n (10^i-1)\equiv c\cdot1\cdot3\cdot7^{n-2}\equiv5c\pmod{8},$$ which shows that $5c$ is a quadratic residue mod $8$. Then $c\equiv5\pmod{8}$ because $c$ is squarefree, and given that $1\leq a\leq9$ this shows that $c=5$ and hence that $a=5$. But clearly $\prod_{i=1}^n(10^i-1)$ is coprime to $5$, so the product cannot be a perfect square.