Can $!1+!2+!3+\cdots+!n$ be a perfect power if $n\geq3$?

Note that $!n$ is a subfactorial.

I do know that $1!+2!+3+\cdots+n!$ is only a perfect power if $n=1, 3$, since when $n\geq9, 1!+2!+3!+\cdots+9!=9\pmod{27}$, so it cannot be a perfect cube, or any higher perfect prime power, and this is never a perfect square if $n\geq5$.

But I don’t see any pattern to $!1+!2+!3+\cdots+!n$, so I cannot know if this can be a perfect power if $n\geq3$.

For example, $!1+!2+!3+\cdots+!16\equiv1\pmod{5,7},0\pmod{9},0\pmod{16}$, so it can a perfect square or a higher perfect power.

On the other hand, $!1+!2+!3+\cdots+!17\equiv8\pmod{9}$, so it is not a perfect square, but it can be a odd perfect power.

Are there any ways to find the remainder of $!1+!2+!3+\cdots+!n$ when divided by $p\geq n$ to determine if $!1+!2+!3+\cdots+!n$ can be a perfect power?

  • 4
    $\begingroup$ Since $!1+!2=1$, maybe change the hypothesis to $n\ge3$. $\endgroup$ Sep 27, 2023 at 9:59
  • $\begingroup$ Usually, $1$ is not considered to be a perfect power , but we can begin with $2$ since $!1=0$. No perfect power upto $n=1\ 000$ (brute force with PARI/GP). $\endgroup$
    – Peter
    Sep 29, 2023 at 22:55
  • $\begingroup$ What is the def of $!n$? $\endgroup$
    – C.F.G
    Oct 6, 2023 at 15:37
  • $\begingroup$ @C.F.G: "Note that $!n$ is a subfactorial." $\endgroup$
    – Shaun
    Oct 6, 2023 at 16:04


You must log in to answer this question.

Browse other questions tagged .