TITLE: Can $N^2$ have only digits 0 and 1, other than $N=10^k$?
QUESTION [47 upvotes]: Pablo Solis asked this at a recent 20 questions seminar at Berkeley. Is there a positive integer $N$, not of the form $10^k$, such that the digits of $N^2$ are all 0's and 1's?
It seems very unlikely, but I don't have a proof. It's easy to see that such a number must end in 1 or 9, and then easy to see that it must end in 01, 49, 51 or 99, and you can continue recursively for as long as you like, determining possible "suffixes". Using this, I had a computer check for me that there are no such N up to about $10^{24}$.
If you pretend that the digits of $N^2$ are randomly distributed, and $N$ has $n$-digits, there's a $(2/10)^{2n}$ chance of satisfying this condition. There are only $10^n$ $n$-digit numbers, so you might expect a $(4/10)^n$ chance of having a some $n$-digit number. This suggests we shouldn't expect to find anything.
(If you try the same problem in other bases, where the probabilities are better, you do find a few:  in base 5, 222112144, 22222111221444 and 100024441003001 work.)

REPLY [8 votes]: Let me redo the probabilistic argument. We know that the $k$ last digits of $n^2$ are determined by the $k$ last digits of $n$. For instance, $n^2$ ends with a $1$ if and only if $n$ ends with a $1$ or a $9$. By induction, one proves that there are $2^k$ $k$-uplets of digits $\bar a=a_1\ldots a_k$ such that the square of a number $n$ ending with $\bar a$ ends with $k$ ones and zeroes. For instance if $k=3$, the triplets are $001,249,251,499,501,749,751, 999$. 
If $n$ is a solution to the problem, and $k$ is the number of digits of $n$, then $n$ must be an $\bar a$ as above. Take the square of such an $\bar a$. We know that its $k$ last digits are ones and zeroes. In order that it provides a solution, the $k$ first digits have to be ones and zeroes, a property whose probability is $5^{-k}$. Therefore, the probability that there be a solution $n$ of length $k$ is approximately $(2/5)^{-k}$. Since the series
$$\sum_{k=1}^\infty\left(\frac{2}{5}\right)^k$$
converges, I bet that there are only finitely many solutions. But if you do not find a short one, I guess there will be no solution at all.