The number $2^{29}$ has exactly $9$ distinct digits. Which digit is missing? 
The number $2^{29}$ has exactly $9$ distinct digits. Which digit is missing?

I came across this question in a math competition and I am looking for how to solve this question without working it out manually. Thanks. 
 A: Oh its so easy, now that we follow the hint (thanks !)
$$\sum k_n  10^n \equiv \sum k_n \mod 9$$
the sum of all the digits is $\frac{9(9+1)}{2}\equiv 0 \mod 9$ so the sum of all but one $x$ is $\equiv -x \mod 9$
Now $$2^{29}\equiv -4 \mod 9$$ so $4$ is the missing digit.
A: A hint: Think about the remainder modulo $9$.
A: Let the number $N$ be represented by $9$ digits $d_i$ for $i=0,\dots,8$ so that 
$$N = \sum_{i=0}^{8} d_i  10^i$$ 
We first notice that 
$$\sum_{i=0}^{8} d_i  10^i \equiv \sum_i d_i \pmod{9}$$
Since only one digit is missing, this sum must be between 36 (with 9 missing) and 45 (with 0 missing). There are two cases to consider.  Either $\sum d_i \equiv 0 \pmod{9}$ or it is not.  In the first case, either 0 or 9 is the missing digit, since those are the only missing values for which $\sum_i d_i \equiv 0 \pmod{9}$, making the sum either 36 or 45. We can determine which is the value by looking at the sum $\pmod{8} = N \pmod{8}$: if this value is 4 then the sum is 36 and 9 is the missing digit.  If $N \equiv 5 \pmod{8}$, then the sum is 45 and 0 is the missing digit.
In the second case, we note that the sum of all but one digit $x$ is congruent to $-x \pmod{9}$.  Solving this congruence for $x$ gives the missing digit.
This addresses the case of an arbitrary $N$ for which $N \equiv 0 \pmod{9}$ which the accepted answer does not handle correctly.  Since I'm not yet allowed to comment or improve other answers by censors, I just constructed a new, complete answer.  Vote it up so in the future I can do this the right way.
A: $2^{29}$ is not that big. You can just compute it. A fast launch point is to know that $2^{10}=1024$. So you just need to multiply $1024\cdot1024\cdot512$, which can be done by hand quickly in a competition.
