Recreationally, I have been studying Fermat numbers and have been trying to come up with a construction to produce arbitrarily large composite Fermat numbers. It's been leading me to many Diophantine equations, which are a new and interesting topic for me.
For example, given two integers $a$ and $b$, I would like to solve for all integers $k$ which satisfy $$ak+b=2^n$$ for any natural number $n$. That is to say, when is $ak+b$ a power of 2? I'm unsure what class of Diophantine equation this falls into, hence web searching has not been very helpful. I looked up "Exponential Diophantine equations", but the results have been seemingly for different types of equations than this one.
Initially, I am not even sure when there exists a solution at all. At the very least, I believe $\gcd(a,b)$ must be a power of 2 itself for there to exist solutions.
In summary, I'm really asking four questions.
(Assuming that it is one), what class of Diophantine equations is this?
When does there exist a solution?
How many solutions can exist?
Given they exist, what are the methods used to find their solutions?
Any insight or links to relevant resources would be greatly appreciated.
If you're give $\ a$, $b$, and $\ n\ $, then there's no solution unless $\ 2^n\equiv b\pmod{a}\ $, in which case the unique value of $\ k\ $ satisfying the equation $$ ak+b=2^n\ , $$ is given by $$ k=\frac{2^n-b}{a}\ . $$ This is guaranteed to be an integer whenever $\ 2^n\equiv b\pmod{a}\ $. As Peter notes in the comments, finding values of $\ n\ $ which satisfy this equation is an instance of the discrete logarithm problem. Efficient methods of solving it are known when $\ a\ $ has only relatively small prime divisors, but not if it has at least one sufficiently large prime divisor.