$|3^a-2^b|\neq p$, from a contest
I recently came across an old contest problem: (I did not find the solution anywhere)
Find the least prime number which cannot be written in the form $|3^a-2^b|$ where $a$ and $b$ are nonnegative integers.
At the beginning I thought that the answer was the number $2$ but the ''nonnegative integers'' allows us to take $a=1$ and $b=0$.
Also we have:
$3=2^2-3^0$
$5=3^2-2^2$
$7=2^3-3^0$
$11=3^3-2^4$
$13=2^4-3^1$
$17=3^4-2^6$
and so on...
Can anybody help me with this?
Thanks in advance
P.S. I am familiar with Pillai's theorem http://mathworld.wolfram.com/PillaisTheorem.html
but i would like to see -if possible- a solution much more simple because it was a contest problem.
One readily finds representations for all primes $<41$.
Assume $41=|3^a-2^b|$ that is $2^b\pm 41=3^a$.
By not finding powers of three among the numbers $2^b\pm41$ with $b\le 2$, we conclude $b\ge 3$. Then $3^a\equiv \pm41\pmod{8}$, which is equivalent to $a\equiv 0\pmod 2$. Especially $3^a\equiv1\pmod {8}$ and hence $41=3^a-2^b$.
Likewise, we can check and exclude small values of $a$, hence know that $2^b\equiv -41\pmod{3}$, which is equivalent to $b\equiv 0\pmod 2$.
But then $a$ and $b$ are both even and we obtain a factorization $41=(3^{a/2}-2^{b/2})(3^{a/2}+2^{b/2})$ and conclude $3^{a/2}+2^{b/2}=41$, $3^{a/2}-2^{b/2}=1$, i.e. $3^{a/2}=\frac{41+1}2$, which is absurd.