# For every prime $p \gt 3$, is there a number $n$ such that $n! \equiv 1\pmod p$?

Consider the sequence of numbers $1$ less than factorials: $1, 5, 23, 119, 719, 5039...$. We have a multiple of $5$ ($5$) and a multiple of $7$ ($119$). But there are no multiples of $2$ or $3$: there can't be, because after the $n$th term, every term is congruent to $-1$ mod $n$.

Are there any other primes that never divide any elements of this sequence? https://oeis.org/A054415 contains some large primes early on, and a sufficiently long run of large primes could "crowd out" some small prime $p$ so that it misses its only $p$ chances to get in. But heuristically it seems like every small prime makes an appearance as a factor (after brute force checking the first 25,000 terms).

By the wilson theorem $$(p-1)! \equiv -1 \pmod {p}$$
Therefore $n=p-2$ works!
• As does $n=1$, of course. – Thomas Andrews Oct 7 '15 at 21:49