Analyzing a Diophantine equation: $A^k + 1 = B!$ Efficient way to solve. I came across a Diophantine equation which has this form:
$$ A^k + 1 = B!$$
Where we are given $A$ and need to find $(k,B) \in \mathbb{N}^2$ (Note, $0 \notin \mathbb{N}$ in this case), such that this equation is satisfied.
I started to analyze this and these are my observations:
$1)  ~~ \text{If} ~~ B \geq A$ then $A \mid B$, so $B = A\cdot t$ for some natural $t$. $A^k + 1 = A \cdot t$. Looking at $\mod(A)$ we get that the $\text{LHS}$ is congruent to $1 \mod(A)$ while the $\text{RHS}$ is congruent to $0 \mod(A)$, thus no solutions exist.
$2) ~~ \text{If} ~~ B < A$ then we have two sub-options:
$ ~~~~~~ 2.1)$ We might be able to solve by checking each value one-by-one ($2 \leq B < A$) which may not
be a lot. $B=1$ isn't a solution because then we would have: $A^k = 0$ which does not have a solution.
$ ~~~~~~ 2.2)$ If $B$ is a solution then: $B \mid A^k + 1, ~~ B-1 \mid A^k + 1, ~~ \dots ~~, 2 \mid A^k + 1$ Meaning $A^k +1$ should be divisible by any number between $2$ and $B$
Another observation is that if $A$ is even, then $A = 2w$ for some natural $w$, and also $B \geq 2$, then no solutions exist, because, $B \geq 2$ and thus even, however the $\text{LHS}$ will be odd: $\text{Even}^{\text{k} + 1} = \text{Even} + 1 = \text{Odd}$.
However, when $A$ is odd, meaning that $A = 2w+1$ for some natural $w$, then nothing helps and the only choice I see here is to check one-by-one, but, the gap between $2$ and $A$ can be big and potentially infinite. For example: $$99^k + 1 = B!$$
Do we need to check each number $2 \leq B \leq 98$ ? Is there a better way to approach this?
I would like to hear if you have more observations I missed, Thank you!.
 A: Given a positive integer $A$, if $k$ and $B$ are positive integers such that
$$A^k+1=B!,$$
it is clear that $A^k$ and $B!$ are coprime. Then also $A$ and $B!$ are coprime, and so $B$ is strictly smaller than the smallest prime factor of $A$. If $A$ is not too large, an effective approach is to determine the smallest prime factor of $A$, and then simply try all values of $B$ up to that prime. In particular, for your example with $A=99$ we see that the smallest prime factor is $3$, so we only need to try $B=2$ to see that there are no solutions.
Note that if you intend to test this for many values of $A$, it may be worth while to verify that $B!-1$ is not a perfect power for any small value of $B$. (Thanks to Peter in the comments $B!-1$ is not a perfect power if $B\leq10^4$.)
Some more general results: A quick check shows that every solution with $B\leq3$ is of the form
$$(A,k,B)=(1,k,2)\qquad\text{ or }\qquad(A,k,B)=(5,1,3).$$
For $B\geq4$ we have $A^k=B!-1\equiv7\pmod{8}$ and so $k$ is odd and $A\equiv7\pmod{8}$. Then
$$B!=A^k+1=(A+1)(A^{k-1}-A^{k-2}+A^{k-3}-\ldots+A^2-A+1),$$
which shows that $A+1$ divides $B!$, so in particular $A+1$ is $B$-smooth. So for every prime $p$ dividing $A$ and every prime $q$ dividing $A+1$ we have $q\leq B<p$.
