# Solutions for diophantine equation $3^a+1=2^b$

I am looking for solutions for the diophantine equation

$3^a+1=2^b$

where $a\in \Bbb N$ and $b\in \Bbb N$.

Is there a power of $3$ that gives a power of $2$ when you add $1$?

Two solutions are easy to find:

1. $3^0+1=2^1 \rightarrow 1+1=2$
2. $3^1+1=2^2 \rightarrow 3+1=4$

But I'm looking for other solutions (solutions where $a>1$).

I believe that there is no other solution, but how can you proof this conjecture?

More general:
How can you find solutions for

$p_1^a+n=p_2^b$

where $p_1$ and $p_2$ are prime and $a,b,n\in \Bbb N$?

$$3^a=2^b-1$$ Let $b=2k, k \in \mathbb N, k \ge 1$ $$3^a=(2^k-1)(2^k+1)$$ Then

$$2^k-1=3^l$$ $$2^k+1=3^m$$ where $m+l=a, m>l$ Then $$3^m+3^l=2^{k+1}$$ $$3^l(3^{m-l}+1)=2^{k+1}$$ Then $l=0, k=1, m=1$

2) Let $b=2k+1$. Then $2^b≡2 (\mod 3)⟹a=0$

• Also, if $b=2k+1$, you have $2^b \equiv 2\ (\textrm{mod}\ 3) \implies a=0$ – Baconaro Dec 21 '16 at 11:14
• @Baconaro: Thank you! – Roman83 Dec 21 '16 at 11:17
• I miss the general part of my question: How does your answer help me to find solutions for 3^a+5=2^b (27+5=32 is one solution for this)? – Hubert Schölnast Dec 21 '16 at 15:44

Another solution: consider the powers of $3$$\pmod 8. We have 3^1\equiv 3\pmod 8 and 3^2\equiv 1\pmod 8. So by induction it follows that 3^{2k+1}\equiv 3\pmod 8 and 3^{2k}\equiv 1\pmod 8, for k\in\Bbb {N} . So 3^a+1 would be congruent with 4 or 2$$\pmod 8$. Therefore we deduce that if $3^a+1=2^b$, then $b\le 2$.

If $b=2$, then $a=1$.

If $b=1$, then $a=0$. Hence all the solutions are the pairs $(a, b)=(0,1), (1,2)$.