# perfect square numbers with $0$ and $1$

I want to show that there is not an integer with digits of only $0$ and $1$ that has at least two $1$ and is a complete square number. I tried to prove it by induction, but I couldn't.

• What did you try to induct on? The number of digits or the number of 1s? Aug 14, 2017 at 16:57
• The number of digits! @Randall if we add a 1 to the number, it will be $10a+1$ and if we add 0 it will be $10a$, where a is a number with n-1 digits,but I can't prove that it is not square!
– user192508
Aug 14, 2017 at 16:59
• You mean the question??? I think so... @ThomasAndrews
– user192508
Aug 14, 2017 at 17:08
• I meant, is there a reason you think there is no such number? For example, if it is from a problem set, there is often reason to believe it is true. :) Aug 14, 2017 at 17:10
• Seems to be a rather hard question. Aug 14, 2017 at 17:40

Not an answer, just a bunch of necessary conditions. So suposse that $N$ has only zeros and ones, is a square but not a power of $10$:

• If there exists such a number, then there exists one that ends with $1$. Indeed, if $N$ ends with zero, then it must have an even number of trailing zeros. If you remove them, the result must be a perfect square. From now, assume that $N$ ends with $1$.
• $\sqrt N$ ends with $1$ or $9$, and begins with $3$ or $1$.
• The number of ones, $k$, is congruent to $N$ modulo $9$. Then $k$ must be a square modulo $9$. That is $k\equiv 0,1,4\text{ or }7\pmod 9$.
• The penultimate digit is $0$, because $11$ is not a square modulo $100$.
• $\sqrt N\equiv \pm1\pmod{50}$ (thanks to Thomas Andrews).

I'll edit this "answer" if I find more of them.

An heuristic reasoning: the probability that a number of at most $n$ digits has only ones and zeros is $1/5^n$. And that it is a perfect square is $1/10^{n/2}$. Assuming that both events are independent, the probability that both conditions hold for the same number is $1/(5\sqrt{10})^n$, which is lesser than $1/10^n$. So... probably, the answer is no.

• It actually ends in $01$. You have that $\sqrt{N}=50k\pm 1$. Aug 14, 2017 at 18:07
• And you can show that $k$ is divisible by $5$. But it gets messier from there. Aug 14, 2017 at 18:08
• @ThomasAndrews The $k$ of your second comment is my $k$ or your $k$? Aug 14, 2017 at 18:10
• Sorry, my $k{}{}{}.$ Aug 14, 2017 at 18:11
• Re: the heuristic, aren't there $9*10^{n-1}$ $n$-digit numbers? Aug 14, 2017 at 18:48