TITLE: $2^n$ base $5$ contains more than ones and zeros?
QUESTION [13 upvotes]: This math problem was posted on The Nineteenth Byte over at Programming Puzzles and Code Golf.
It states this: Prove that for all integers $n > 0, 2^n$ will contain a digit other than $1$ and $0$ in base $5$.
TNB came up with these conditions for a counterexample:
$2^n \text{ mod } 5 = 1$ ; $2^n \text{ mod } 10 = 6$ ; and $n \text{ mod } 4 = 0$

REPLY [2 votes]: We assume it can be written as $N=5^{a_i} + 5^{a_{i-1}} +・・・+ 5^{a_1} + 1$ 
Since this equal to $2^n$. Let $n=4m$,
$2^{n}-1$
$=16^{m}-1$
$=(3*5+1)^m-1 $
$=(3*5)^m+・・・+m(m-1)/2*(3*5)^2+5*3m$
It must be $3m=5^{b_1}=1$, or $5^{b_1}+1$. $9m(m-1)/2$ must be $5^{b_2},5^{b_2}+1$. So possible case are two. 
$(i)$  $5^{b_1}*3(m-1)/2=5^{b_2}+1$
this leads $-5^{b_2-b_1}=2,b_1=0$. This is false.
$(ii)$ $9m(m-1)/2=5^{b_2}+1$
$⇔(5^{b_1}+1)*(5^{b_1}-2)=2(5^{b_2}+1)$
$-2 \not \equiv2 \mod 5 $ This is a contradiction.
Therefore it was proved there are no $2^n$ of base 5 which is made of only $0$ and $1$.