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!

  • 2
    $\begingroup$ As does $n=1$, of course. $\endgroup$ – Thomas Andrews Oct 7 '15 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.