Can a number written only with zeros, threes, fives, sevens and eights be a perfect square

elementary-number-theorysquare-numbers

Can a number written only with zeros, threes, fives, sevens, and eights be a perfect square?

I've tried to look at the residues modulo $3$ and $9$ with the sum of the numbers, but I've gotten no useful conclusions, and now I got no idea what I can do. Please, help me solve it!

Best Answer

Let’s say there is such a square $n$ that is entirely comprised of the digits $0,3, 5,7$ and $8$. Then $n \pmod {10}$ would have to be one of $0,3,5,7$ or $8$. To make answering this question a little easier, let’s ignore the case when $0 \equiv n \pmod {10}$ for right now.

Let’s see what happens when we square all digits from $1$ to $9 \pmod {10}$.

$1^2 \equiv 9^2 \equiv 1 \pmod {10} \\ 2^2 \equiv 8^2 \equiv 4 \pmod {10} \\ 3^2 \equiv 7^2 \equiv 9 \pmod {10} \\ 4^2 \equiv 6^2 \equiv 6 \pmod {10} \\ 5^2 \equiv 5 \pmod {10}$

As we can see, squaring any digit other than $5$ yields an ending digit outside of your specified criteria. Thus if $n$ exists, it must end in $5$.

Well, what about the other digits? Suppose $n=m^2$ for some $m \in \mathbb{N}$. Then $m$ must end in $5$ and so it can be written as $10a+5$ for some $a \in \mathbb{N}$ (namely $a= \frac{m-5}{10}$). Notice that $$m^2= (10a+5)^2 = 100a^2+ 100a + 25$$ Thus $n = m^2 \equiv 25 \pmod{100}$, but as per your restrictions, $n$ cannot contain the digit $2$ and hence cannot end in $5$.

Lastly, we consider when $n$ ends in $0$. If $n= 0$ then the answer is trivial so we’ll suppose $n \neq 0$. Then, as shown above, $n$ cannot end in $1, \dots, 9$. So then $n$ must end in $0$. Again we consider $n=m^2$ and see that $m$ can be written as $10a$ for some $a \in \mathbb{N}$. This time $m^2=(10a)^2=100a^2$. So again we are faced with the same problem, since the digits of $a^2$ must be within your requirements.

I hope this suffices to answer your question!

Related Question