TITLE: Find all positive integers $n$ such that sum of digits of $2^n$ is equal to $n$.
QUESTION [6 upvotes]: For example, $2^5=32$ and $3+2=5$. Similarly, it can be shown that it works for $2^{70}$. 
Using basic results in modular arithmetic, one can show that $n$ has to be either of the form $18k+5$ or $18k+16$, where $k$ is non-negative integer. The two examples satisfy the form (for $k=0$ and $k=3$) but I was not able to find other examples. 
I do know that $2^n$ has $\left \lfloor    n\cdot \log_{10}2\right \rfloor+1$ digits which, coupled with the fact that average digit value is $4.5$, implies that the average digit sum is about $1.35n$. Clearly, this is much larger than $n$ (for large $n$) so it may be that no other $n$ satisfies the question I posed. 
Any ideas how to proceed?

REPLY [2 votes]: Here are the heuristic considerations:
Suppose for each positive integer $n$ you took $c n$ iid random variables $X_i(n)$ (where $4.5 c > 1$), each having values $0,\ldots,9$ with equal probability, and let $S_n$ be their sum.  According to Cramer's Theorem from the theory of
Large Deviations, $\log P(S(n) \le n)$ is asymptotic to a negative constant times $n$ (where the constant can be computed, but I won't bother).  In particular $\sum_{n=1}^\infty P(S(n) \le n) < \infty$.
Then, according to Borel-Cantelli, almost surely only finitely many of the
events $S_n \le n$ occur.  With a bit more work you can estimate the expected number of occurrences.
Of course the digits of powers of $2$ are not really random, but it's quite reasonable to expect, on this basis, that there are only finitely many $n$ for which the sum of the digits of $2^n$ is at most $n$.