Primes as a difference of powers Find the smallest prime that cannot be written as
$$|3^a - 2^b|$$   
EDIT: I forgot to mention that $a$ and $b$ are whole numbers.

I tried to expand $3^a$ as $(2+1)^a$ using binomial theorem but I couldn't infer much. Please help. Thanks in advance!

 A: $41$ is the answer. 
For $41=3^a-2^b$, clearly $b \not =0, 1, a \not =0$. $\pmod{3}$ gives $b$ even, $\pmod{4}$ gives $a$ even. Then $41=(3^{\frac{a}{2}}-2^{\frac{b}{2}})(3^{\frac{a}{2}}+2^{\frac{b}{2}})$, so $3^{\frac{a}{2}}-2^{\frac{b}{2}}=1, 3^{\frac{a}{2}}+2^{\frac{b}{2}}=41$, which is clearly impossible.
For $41=2^b-3^a$, clearly $b \geq 3$. $\pmod{8}$ gives a contradiction. 
Note $2=3^1-2^0, 3=2^2-3^0, 5=2^3-3^1, 7=3^2-2^1, 11=3^3-2^4, 13=2^4-3^1, 17=3^4-2^6, 19=3^3-2^3, 23=3^3-2^2, 29=2^5-3^1, 31=2^5-3^0, 37=2^6-3^3$.

P.S. Try this problem instead:

Determine whether there are infinitely many primes $p$ s.t. $p$ cannot be expressed as the sum or difference of a power of $2$ and a power of $3$, i.e. $p \not =|3^a \pm 2^b|$.

A: $2$.  The second subtrahend is always $0~ (\text{mod}~ 2)$ and the first never is, so their difference can never be $\pm2$.
Conveniently, there are no smaller primes to check.
If on the other hand, $a$ and $b$ can be zero, then you break your problem into eight Pell equations and solve the set sequentially over primes until you find a prime that can't be solved in your desired form.  The Pell equations are: \begin{align}
x^2 - y^2 &= p  \\
-(x^2 - y^2) &= p \\
3x^2 - y^2 &= p \\
-(3x^2 - y^2) &= p \\
x^2 - 2y^2 &= p \\
-(x^2 - 2y^2) &= p \\
3x^2 - 2y^2 &= p \\
-(3x^2 - 2y^2) &= p 
\end{align}  This set of Pell equations comes from considering the exponents to be even or odd.  If an exponent is odd, extract one power of $2$ or $3$ as a coefficient and the remaining exponent is even.  Things with even exponents are squares.  For each prime, $p$, see if any of these Pell equations are solvable with $x$ a power of $3$ and $y$ a power of $2$.  If not, you have found your solution.
\begin{align}
2 &: &3 \cdot 1^2 - 1^2 = &|3^1 - 2^0| = 2 \\
3 &: &-(1^2 - 2^2) = &|3^0 - 2^2| = 3 \\
5 &: &               &|3^2 - 2^2| = 5 \\
  &  &               &|3^1 - 2^3| = 5 \\
7 &: & -(3^2 - 4^2) = &|3^2 - 2^4| = 7 \\
  &  & 3^2 - 2 \cdot 1^2 = &|3^2 - 2^1| = 7 \\
  &  & -(1^2-2 \cdot 2^2) = &|3^0 - 2^3| = 7 \\
\vdots \\
37&: & -(3\cdot 3^2 - 8^2) = &|3^3-2^6| = 37 \\
41&: & \text{no solutions}
\end{align}
and we find 41 is the first prime with no solution to any of these Pell equations of the desired form.  (It has solutions to the Pell equations where not both $x$ is a power of 3 and $y$ is a power of 2, so not of the desired form.)
A: Tried to find all the prime numbers by trial and error. Didn't get any combination for 41. So, it is a possible answer. Correct me if I am wrong!
