

A166864


Primes p that divide n!  1 for some n > 1 other than p2.


1



17, 23, 29, 31, 53, 59, 61, 67, 71, 73, 83, 89, 97, 103, 107, 109, 137, 139, 149, 151, 167, 193, 199, 211, 223, 227, 233, 239, 251, 271, 277, 283, 307, 311, 331, 359, 379, 389, 397, 401, 419, 431, 439, 449, 457, 461, 463, 467, 479, 487, 499, 503, 521, 547, 557
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

Since n!  1 = 0 for n=1 and n=2, the restriction n > 1 needed to be placed.
For n >= p, p is one of the factors of n!, so p cannot divide n!  1.
For n = p1, by Wilson's Theorem, (p1)! = 1 (mod p), so p divides (p1)! + 1, and cannot also divide (p1)!  1 unless p = 2.
For n = p2, again by Wilson's Theorem, (p1)! = (p1)(p2)! = (1)(p2)! = 1 (mod p), so (p2)! = 1 (mod p) and p divides (p2)!  1. As a result, only 2 <= n <= p3 needs to be searched.


LINKS

Table of n, a(n) for n=1..55.
Eric Weisstein's World of Mathematics, Wilson's Theorem


EXAMPLE

17 is included in the sequence since 17 divides 5!  1 = 119.
19 is not included in the sequence since the only n for which 19 divides n!  1 is n = 17.


PROG

(PARI) isA166864(n) = {local(r); r=0; for(i=2, n3, if((i!1)%n==0, r=1)); r}


CROSSREFS

Cf. A000142, A002582, A033312, A054415.
Sequence in context: A214791 A050712 A068581 * A137670 A330600 A217044
Adjacent sequences: A166861 A166862 A166863 * A166865 A166866 A166867


KEYWORD

nonn


AUTHOR

Michael B. Porter, Oct 22 2009


STATUS

approved



