Odd perfect squares whose decimal representation consist only of 1's and o's

Solution 1:

Just some working:

if $x=d_m d_{m-1} d_{m-2}\dots d_1 d_0, \space d_0 = 1, d_i=0 \text{ or } 1$ is the number we're looking for,

denote $x_n=d_m d_{m-1} d_{m-2}\dots d_{n+1} d_n$

So, $$ x =x_0 = 10x_1+d_0 = 10x_1+1 =y^2 $$ for some $y$ $$ 10x_1+1=y^2 $$ $$ 10x_1=y^2-1 $$ $$ 10x_1=(y+1)(y-1) $$ $$ 2.5.x_1=(y+1)(y-1) $$

so $$ y+1=2k \text{ or } 5k $$ or $$ y-1=2k \text{ or } 5k $$

$$ y=2k-1 \text{ or } 5k-1 \text{ or } 2k+1 \text{ or } 5k+1 $$

I.e $ y = 1 \mod 2, \text{ or } \space 1 \text{ or } 4 \mod 5 $.

Also $ x_1=10x_2 + d_1 $ so $ x_1=10x_2 \text{ or } x_1=10x_2 + 1 $

I.e. $$ 10(10x_2[+1])+1=y^2 $$ $$ 100.x_2=y^2-[1,11] $$ So $$ 10^2.x_2=[2k-1 \text{ or } 5k-1 \text{ or } 2k+1 \text{ or } 5k+1]^2-[1,11] $$ $$ =2^2k^2-2k-[0,10] $$ or $$ =2^2k^2+2k-[0,10] $$ or $$ =5^2k^2-10k-[0,10] $$ or $$ =5^2k^2+10k-[0,10] $$

Similarly $ x_2 = 10x_3+d_2 = 10x_3 \text{ or } 10x_3 + 1 $

$$ 10^3.x_3 $$ $$ =2^2k^2-2k-[0,10,20] $$ or $$ =2^2k^2+2k-[0,10,20] $$ or $$ =5^2k^2-10k-[0,10,20] $$ or $$ =5^2k^2+10k-[0,10,20] $$

Generalising $$ 10^n.x_n $$ $$ =2^2k^2-2k-10l $$ or $$ =2^2k^2+2k-10l $$ or $$ =5^2k^2-10k-10l $$ or $$ =5^2k^2+10k-10l, 0<=l<n $$

So firstly, $ \mod 10 $ $$ 2^2k^2-2k = 0 $$ or $$ 2^2k^2+2k = 0 $$ or $$ 5^2k^2 = 0 $$

i.e $$ k = 0 \mod 2 $$

let $ 2j=k $ i.e. $$ 10^n.x_n $$ $$ =16j^2-4j-10l $$ or $$ =16j^2+4j-10l $$ or $$ =100j^2-20j-10l $$ or $$ =100j^2+20j-10l, 0<=l<n $$

And for anyone looking on, the $j$, $l$ and which "or" formulae can (will) vary for each $n$.

Solution 2:

Edit: Yep, as pointed out in the comments, my proof is wrong. I totally expected something like this. The fatal problem is that I missed some counterexamples in the general case.

I'm leaving this answer up, because as a rule I don't delete posts just for stuff like this, but that's what you get for trying to dive in head-first, I guess. /edit


I know this is an old question, but I figured this would be a good exercise. First post on MSE, yadda yadda yadda. Hopefully the proof checks out.

I claim that there are no odd integers $x > 1$ such that the decimal representation of $x^2$ contains only the digits 0 and 1.

Suppose $x^2\equiv 1 \mod 10$. Then $$x \equiv \pm1 \mod 10$$ Now we have $$x^2\equiv 1\vee x^2\equiv 11 \mod 100$$ ($81=9^2$ is not counted since we are only allowed to use the digits 0 and 1).

But $11$ is not a perfect square. So that leaves only $$x^2 \equiv 1 \mod 100.$$

In general, we can suppose we have proven that $$x^2\equiv 1 \mod 10^k$$ It follows from this that $$x\equiv \pm 1 \mod 10^k$$ Now notice that $$x^2\equiv 1 \vee x^2\equiv 10^{k}+1 \mod 10^{k+1}$$ since by incrementing $k$, we are essentially adding another digit to the left of the number. By our rule, this extra digit can only be 0 or 1.

Now we need to show that $\sqrt{10^k+1}$ is irrational (see below). Then we are left with $$x^2\equiv 1 \mod 10^{k+1}.$$

By induction, therefore, $x^2\equiv1 \mod 10^k$ for all $k \ge 1$. Thus, the trivial $x^2=1$ is the only solution.


Now for my argument that $\sqrt{10^k+1}$ is irrational for all $k$:

Suppose $k\ge 0$ is even; then $10^k$ is a perfect square; thus $10^k+1$ is not a perfect square.

The case for odd $k$ can be verified numerically: we simply note that $\sqrt{10^k+1}-\sqrt{10^k}$ converges to zero for large $k$, and that $\sqrt{10^k}$ is irrational for odd $k$.