A166862 Primes p that divide n! + 1 for some n other than p-1.
2, 7, 11, 19, 23, 29, 43, 47, 59, 61, 67, 71, 79, 83, 103, 109, 127, 131, 137, 139, 149, 163, 179, 191, 193, 199, 227, 233, 239, 251, 257, 263, 269, 271, 277, 293, 307, 311, 317, 347, 359, 367, 379, 383, 389, 397, 401, 419, 431, 443, 449, 461, 463, 467, 479
Offset: 1
Keywords
Examples
11 is included in the sequence since 11 divides 5! + 1 = 121. 13 is not included in the sequence since the only n for which 13 divides n! + 1 is n = 12.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Wilson's Theorem
Programs
-
PARI
isA166862(n) = {local(r);r=0;for(i=0,n-2,if((i!+1)%n==0,r=1));r}
-
PARI
is(p)=my(m=Mod(1,p)); for(k=2,p-2,m*=k; if(m==-1, return(isprime(p)))); p==2 \\ Charles R Greathouse IV, Apr 17 2013
Comments