Odd Numbers not Sum of Prime and Power

Theorem
The sequence of odd numbers which cannot be expressed as the sum of a perfect power and a prime number begins:
 * $1, 5, 1549, 1 \, 771 \, 561, \ldots$

It is not known if there are any more terms.

Proof
The cases $1$ and $5$ are trivial.

Now we show that $1549 - a^b$ is never prime for $a \ge 1$ and $b \ge 2$.

It suffices to show the result for prime values of $b$.

We first prove:

For $(1)$:

Suppose $a$ is odd.

Then so is $a^b$.

Therefore $1549 - a^b$ is even.

Hence $1549 - a^b$ is prime only if it is equal to $2$.

But $1547$ is not a perfect power.

For $(2)$:

Suppose $b = 2$ and $a$ is not divisible by $3$.

By Corollary to Square Modulo $3$:
 * $3 \divides \paren {a^2 - 1}$

Hence:
 * $3 \divides \paren {1548 - a^2 + 1} = 1549 - a^b$

So $1549 - a^b$ is prime only if it is equal to $3$.

But $1547$ is not a perfect square.

For $(3)$:

Suppose $a^b \equiv 4 \pmod {10}$.

Then $1549 - a^b \equiv 5 \pmod {10}$

So $1549 - a^b$ is prime only if it is equal to $5$.

But $1544$ is not a perfect power.

Hence we only need to check the cases:
 * For $b = 2: \: 6^2, 12^2, 18^2, 24^2, 30^2, 36^2$ since $42^2 > 1549$
 * For $b \ne 2: \: 2^3, 2^5, 2^7, 4^3, 4^5, 6^3, 8^3, 10^3$ since $2^{11}, 4^7, 6^5 > 1549$

of which $12^2 \equiv 18^2 \equiv 4^3 \equiv 4^5 \equiv 4 \pmod {10}$, so they are rejected.

We have:

and none of the above are prime.