Is $7$ the largest possible value of $n$ for which $(1!+2!+3!+…n!)+16$ is a perfect power?

Is $$7$$ the largest possible value of $$n$$ for which $$(1!+2!+3!+…n!)+16$$ is a perfect power?

I noticed that $$(7!+6!+5!+4!+3!+2!+1!)+16=77^2$$ is a perfect power, and I don’t know if that is the largest possible value of $$n$$ for which $$(1!+2!+3!+…n!)+16$$ is a perfect power?

I can conclude that $$(1!+2!+3!+…n!)+16$$ is never a perfect cube if $$n\geq6$$, since it is equal to $$4\pmod{9}$$, but I don’t know if $$(1!+2!+3!+…n!)+16$$ can be a perfect square.

Since the last digit of $$(1!+2!+3!+…n!)+16$$ is $$9$$, I think it can be a perfect square if $$n\geq8$$, since the sum is $$1\pmod{8}$$, and $$1\pmod{3}$$.

I can also conclude that $$(1!+2!+3!+…n!)+16$$ cannot be a perfect 5th power if $$n\geq10$$, since $$29$$ is not a 5th power residue $$\pmod{100}$$.

Other than $$3, 4, 5, 7$$, are there any values of $$n$$ such that $$(1!+2!+3!+…n!)+16$$ is a perfect power?

Edit:

• Since $$3$$ is not a 7th power residue $$\pmod{29}$$, $$(1!+2!+3!+…n!)+16$$ cannot be a perfect 7th power if $$n\geq28$$.
• I checked the first 20,000 (just using a simplistic brute force approach) and there is no other square apart from the first 4 solutions in your post. At this point, numbers are getting close to 100,000 digits so brute force becomes impractical.
– PC1
Aug 4, 2023 at 20:06
• Is $~6 = 2^1 \times 3^1~$ to be considered a perfect power? Aug 4, 2023 at 22:00
• the power (exponent) on a perfect power must be 2 or more. So 6 isn't one. Aug 7, 2023 at 3:22

$$(1! + 2! + 3! + \ldots + n!) + 16 \equiv 14 \pmod{49}$$ for $$n \ge 13$$. So $$(1! + 2! + 3! + \ldots + n!) + 16$$ is not a perfect power if $$n \ge 13$$.

• Can you explain why $f(n)\equiv14 (\text{mod } 49)$ make it so that it's not a perfect power? More specifiacally, is $\text{mod }49$ more special than other $p^2$-type mods? And why does it verify, for instance, that $f(345)\neq 103^{19}$? Aug 7, 2023 at 7:32
• This congruence implies that $f(n)$ is divisible by 7, but not divisible by $7^2$. But perfect power must be divisible by the square of all its prime divisors. $\mod 49$ is the first modulo for which there is a contradiction Aug 7, 2023 at 8:39
• If $a^n\equiv 14\pmod{49}$ then $7|a$. But then $49|a^2$; so there's no such $a$. To your second point, $103^19\equiv 47\pmod{49}$, so isn't really relevant. Aug 7, 2023 at 8:43
• Nice explanations, Denis and Chris, it all makes sense now. My question was dumb, I guess. Aug 7, 2023 at 10:05
• @VeselinDimov not really, a lot of the implication is left for the reader. If you had the question, so did others. Aug 7, 2023 at 15:48

A proof for perfect even power $$m^{2k}$$

Assume, on the contrary, that $$n>7$$, then $$n! \equiv 0 \quad \pmod {32}$$ and

\begin{aligned} & 1 !+2 !+3 !+ 4!+5!+6! +7 !+8 !+\cdots+n !+16 \\ \equiv & 1+2+6+24+120+720+5030+16 \\ \equiv & 5919 \\ \equiv & -1(\bmod 32) \end{aligned}

which contradicts to the fact that $$m^{2k}\not \equiv -1\quad \pmod {32}$$ for any integers $$m$$ and $$k$$.

Therefore $$1 !+2 !+3 !+4!+5!+6!+7 !+8 !+\cdots+n !+16$$ is never a perfect even power for $$n>8$$. On the other hand, $$1 !+2 !+3 !+\ldots+7 !+16=77^2$$ reveals that $$7$$ is largest integer to make the sum a perfect even power.

Unfortunately, this method can’t be applied to perfect odd powers.