TITLE: What values can $2^j-3^k$ have?
QUESTION [5 upvotes]: What values can $2^j-3^k$ have? 
E.g., 
$$
2^2-3^1=1\\
2^2-3^0=3\\ 
2^3-3^1=5\\ 
2^4-3^2=7
$$
Can every number not divisible by $2$ or $3$ be written as $2^j-3^k$? If not, why?

REPLY [4 votes]: we try to find an $n$  coprime to $6$ such that $2^j-3^k$ doesn't cover all options $\bmod n$.
Since we want $2^j$ to cover a small number of cases we are going to try with $n=2^m-1$.
We find that the order of $3\bmod 511$ is $12$ and the order of $2\bmod 511$ is clearly $9$.
Thus only a small fraction of residues $\bmod 511$ are covered by $2^j-3^k$.