<s>[INST] FInd the missing digit in $2^{29}$ given all nine digits differ The number $2^{29}$ has (in base $10$) $9$ digits, all different. Which digit is missing?
I think about using fermats theorem dosen't know how to begin
 [/INST] $2^{29}\equiv2^{-1}\equiv\frac{1}{2}\equiv\frac{10}{2}\equiv5\equiv \text{s} \pmod 9$ where $\text{s}$ denotes the sum of its digits.
The sum of the ten digits is $\text{S}=0+1+2+3+4+5+6+7+8+9=\frac{1}{2}\times10\times9=45\equiv0 \pmod 9$
Therefore, if $2^{29}$ contains $9$ of these and the remaing one is $n$, $2^{29}\equiv S-n\equiv-n \pmod{9}$
so $s\equiv-n\equiv5 \pmod{9}$ and the missing digit is $n=4$.
</s>