Does there exist a power of 2 whose last 100 digits are composed only of the digits 1 or 2?

I didn't think I needed to write an answer, but since there have been quite a few incorrect approaches noted so far, I'm going to write up a more detailed version of the comments I posted yesterday.

First off, let me prove the claim that given a power of $2$, let's say $2^k$, $k\in\mathbb N$, for any $n\leq k$, the last $n$ digits of $2^k$ has $2^n$ as a divisor.

Note that $2^n\mid 2^k$, and if we denote $m_n$ to be the last $n$ digits of $2^k$, then $$2^k\equiv m_n\bmod{10^n}$$Since $2\mid 10$, this implies $$2^k\equiv m_n\bmod{2^n}$$But, we already said that $2^n\mid 2^k\to2^k\equiv0\bmod{2^n}$. Hence, $$m_n\equiv0\bmod{2^n}$$

Knowing this, it's easy to show that it's not possible to have a power of two ending in $100$ $1$s or $2$, since $4\not\mid11,22$.

So, we know that the last $n$ digits of our chosen number must be divisible by $2^n$. We can use this fact for $n=1\to100$ to find what the last $100$ digits of the power of $2$ (if it exists) must be.

Before we do this, it's worth observing why these last $100$ digits are unique. Note that at position $1\leq n\leq 100$ (where position $1$ is the units digits, $2$ the tens, etc), we have the choice of either $1$ or $2$. Using the notation from before, we know that $2^{n-1}\mid m_{n-1}$, so $m_{n-1}\equiv2^{n-1}\bmod{2^n}$, or $m_{n-1}\equiv0\bmod{2^n}$. Note that $1\cdot10^{n-1}\equiv2^{n-1}\bmod{2^n}$ and $2\cdot10^{n-1}\equiv0\bmod{2^n}$, so when $m_{n-1}\equiv2^{n-1}\bmod{2^n}$, placing $1$ in position $n$ satisfies the condition presented above, while placing $2$ doesn't, and vice versa when $m_{n-1}\equiv0\bmod{2^n}$.

This establishes the uniqueness of the last $100$ digits. I generated these digits using python:

$12112112112211212112111211221222112122211121221111222121122121211121211211$ $22111112111211111212122112$


Let $q_n$ for $n>0$ be the recurring sequence of natural numbers defined by: \begin{align} &q_1=1&&q_{k+1}=\frac{q_k+5^k(2-q_k\bmod 2)}2 \end{align} then for every $k>0$ the number $a_k=2^kq_k$ satisfy:

  1. $0<a_k<10^k$;
  2. the decimal digits of $a_k$ belongs to $\{1,2\}$;
  3. there exists $m\geq k$ such that $2^m\equiv a_k\pmod{10^k}$.

While (1) and (2) are easily proved by induction, to prove (3), note that $5\nmid q_k$, for otherwise $10\mid a_k$ but this would implies that the last digit of $a_k$ is zero - a contradiction. Since $2$ is a primitive root modulo $5^k$, there exists $n>0$ such that $$2^n\equiv q_k\pmod{5^k}$$ Then multiplying by $2^k$, we get $$2^{n+k}\equiv a_k\pmod{10^k}$$


To generate the recurrence above: assume $2^m\equiv a_k\pmod{10^k}$ with $m\geq k$ and $a_k=2^kq_k$ and let $2^n\equiv 10^kd+a_k\pmod{10^{k+1}}$ with $d\in\{1,2\}$ and $n\geq k+1$. Dividing by $2^k$ we get $2^{n-k}\equiv 5^kd+q_k\pmod{2\cdot 5^{k+1}}$, hence reducing modulo $2$, we get $d\equiv -q_k\pmod 2$. Since $d\in\{1,2\}$, we have $d=2-q_k\bmod 2$. Moreover, $$2^n\equiv 2^k(5^kd+q_k)=2^{k+1}q_{k+1}\pmod{10^{k+1}}$$ where $q_{k+1}=\frac{q_k+5^kd}2$.