I’m in trouble with this problem. The following is what I have done until now. First of all $a$ must be prime because if $(a-1)!+1=a^n$ then is true also that $ (a-1)!\equiv -1\pmod{a}$ and so, by Wilson’s theorem $a$ is prime.
$(1,n)$ is not a solution. Consider $a\neq1$ and $n=1$: we then have $(a-2)!=1$ and so when $n=1$ the solutions are $(2,1)$ and $(3,1)$.
Consider $n=2$. We then have $$ (a-2)!=a+1 $$ $a=5$ is a solution but $a=7$ is not and in particolar $5!>8$ and, due to the rapid explosion of the factorial we do not have other solution when $n=2$.
Consider now $n>2$. We could write by hypothesis $$ (a-1)!=(a-1)(a-2)!=a^n-1=(a-1)(a^{n-1}+...+a+1) $$ By Wilson theorem we could write: $$ (a-2)!=ak+1 $$ for some integer k and so simplifying: $$ k=a^{n-2}+...+a+1 $$ Now because $a$ is prime (and $a>3$) it is odd and so if $n$ is even (odd) $k$ is a sum of a odd (even) number of odd addends and so it is odd (even). If $k$ is even we have that $ak+1$ is odd, but $ak+1=(a-2)!$ and $(a-2)!$ is even, thus we must have $k$ odd and so $n$ must be a even integers.
I do not know if for $n>2$ even there are other solutions, I can’t go further.
Thanks for any advice!