I thought something fancy can be done with number-theory or memoization, but neither worked for me. Being limited in knowledge I decided to ask experts.
Does there exist a deterministic polynomial-space algorithm for the following decision problem?
Instance: Two positive integers $k$ and $m$ in decimal representation.
Question: Is $2^k+m$ a prime number?
Some comments:
By polynomial-space I mean that the space complexity of the algorithm should be bounded by a polynomial in the input length $\log k+\log m$.
The naive approach to this problem determines the decimal representation of $2^k+m$ and then applies a fast primality testing algorithm. It is easy to see that this naive approach requires exponential space, just for writing down the decimal representation of $2^k+m$.
This is related to another question of mine.