cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A197636 Non-Wilson primes: primes p such that (p-1)! =/= -1 mod p^2.

Original entry on oeis.org

2, 3, 7, 11, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 569
Offset: 1

Views

Author

Jonathan Sondow, Oct 19 2011

Keywords

Comments

All primes except 5, 13, 563, and any other Wilson prime A007540 that may exist.
Same as primes p that do not divide their Wilson quotient ((p-1)!+1)/p.
Wilson's theorem says that (p-1)! == -1 (mod p) if and only if p is prime.
p = prime(i) is a term iff A250406(i) != 0. - Felix Fröhlich, Jan 24 2016
Complement of A007540 in A000040. - Felix Fröhlich, Jan 24 2016

Examples

			2 is a non-Wilson prime since (2-1)! = 1 ==/== -1 (mod 2^2).
		

Crossrefs

Programs

  • Mathematica
    Select[Prime@ Range@ 104, Mod[Factorial[# - 1], #^2] != #^2 - 1 &] (* Michael De Vlieger, Jan 24 2016 *)
  • PARI
    forprime(p=1, 500, if(Mod((p-1)!, p^2)!=-1, print1(p, ", "))) \\ Felix Fröhlich, Jan 24 2016

Formula

((p-1)!+1)/p =/= 0 (mod p), where p is prime.