# For any $k \gt 3$, if $n!+k$ is a perfect power then does there exist any $n\gt k$?

A while ago, I asked a similar question For any $$k \gt 1$$, if $$n!+k$$ is a square then will $$n \le k$$ always be true? where users mathworker21 and WE Tutorial School proved that for non-square $$k$$, $$n\le k$$ is always true when $$n!+k$$ is sqaure.

Recently I got the idea to check if the property is true for all perfect powers and using PARI, I observed that if, $$n!+k=a^b$$ where $$n, k, a, b\in \Bbb{N}$$, $$k\gt 3$$ and $$b\ge 2$$, then $$n\le k$$ is always true. In search for a counter-example, I covered a range of $$k\le 2500$$ and $$n\le 10^4$$ for each $$k$$ and found none.

So my question is,

If true, can we prove/partially prove that $$n\le k$$ always holds? If false, then what is the smallest counter-example where $$n\gt k$$?

• If $k=rs$ with $1<r<s$ and $n!+k=a^b$ with $b\geq2$, then by the same argument as in the linked question $$\frac{a^b}{k}=\frac{n!}{k}+1=k\frac{n!}{rsk}+1,$$ which shows that $\tfrac{a^b}{k}$ is coprime to $k$, so $k=c^b$ for some positive integer $c$, and also $$\frac{n!}{k}+1=d^b,$$ for some positive integer $d$. We also get the expression $$n!=a^b-c^b=c^b(d^b-1).$$ – Servaes Mar 19 at 23:44
• In the remaining case, either $k$ is prime $p$ or $k$ is the square of a prime $p$. If $k\leq n$ then $p$ divides $n!$ and hence also $$n!+k=a^b,$$ so $p^b$ divides $n!+k$. If $b=2$ then the linked question settles it. If $b>2$ then $p^3$ divides $a^b$ but not $k$, hence $p^3$ does not divide $n!$. This means $n<3p$ and so we arrive at a contradiction if $k\geq3p$, i.e. if $k=p^2$ with $p\neq2$. This leaves the cases when $k$ is prime and when $k=4$. – Servaes Mar 19 at 23:49
• In particular, my first comment shows that the factors of $c$ are 'small' compared to $n$; if $p\mid c$ then $p^b\mid n!$ so $bp\leq n$ (or $p\leq b$). On the other hand, the factors of $d$ are 'large' compared to $n$; if $p\mid d$ then $p>n$ because $d$ is coprime to $n!$. – Servaes Mar 19 at 23:53
• I checked upto $n=7\ 000$ , but with all $k<n$ , no counterexample – Peter Mar 20 at 17:53
• whoah, why did this get $4$ (!!) downvotes? – mathworker21 May 1 at 12:01