13

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!

jiraffe
  • 165
  • If there is, there must be one which ends in $5.$ Show that isn't possible. – Thomas Andrews Jul 26 '23 at 23:09
  • @ThomasAndrews, why can't we have a perfect square that does not end with 5? Why did you say that there "must" be one which ends with 5? – jiraffe Jul 26 '23 at 23:12
  • 5
    You can have one that ends in $0,$ but the last non-zero digit must be $5.$ So the numbers that end in non-zero digits must end in $5.$ (However, there is one such square, since $0$ is a square, and only uses those digits.) – Thomas Andrews Jul 26 '23 at 23:15
  • @ThomasAndrews, unfortunately I vaguely understand your hints right now. I can't understand the reason why you choose exactly this "5" digit – jiraffe Jul 26 '23 at 23:26
  • To understand Thomas Andrews hint look at the last digits of squares. – jjagmath Jul 26 '23 at 23:32
  • @jjagmath, okay : if number contains number 5 it ends with it because every perfect square with 5 must end with 5, now I get it – jiraffe Jul 26 '23 at 23:36
  • 3
    Not exactly. The point is that no square ends in $2$,$3$,$7$ or $8$. – jjagmath Jul 26 '23 at 23:47
  • @jjagmath, To prove that, can we look at the possible remains of the full square modulo 10? If we go over them, it’s like he can’t have the numbers as his leftovers? – jiraffe Jul 26 '23 at 23:51
  • @jjagmath, yes, now I can prove that no square ends in 2, 3, 7 or 8 – jiraffe Jul 26 '23 at 23:59
  • @ThomasAndrews, I'm sorry for my stupidness, but after realizing that a perfect square does not finish with 2, 3, 7, 8 and can finish only in 5 or 0 but I still can't understand your first and second messages – jiraffe Jul 27 '23 at 00:10
  • @jjagmath, now I understand everything except of "However, there is one such square, since 0 is a square, and only uses those digits." I guess we should show that there is no such perfect squares at all, and I can't understand the meaning of "there is one such square" – jiraffe Jul 27 '23 at 00:23
  • Your last comment leads to the old question, is $0$ a perfect square? – peterwhy Jul 27 '23 at 00:28
  • 1
    Thomas Andrews observed that the answer to your question is "Yes", there exists a perfect square that use those digits: $0$. – jjagmath Jul 27 '23 at 00:28

1 Answers1

23

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!

shanksion
  • 383