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.

Showing 1-3 of 3 results.

A079853 Primes p for which (p-2)! == 1 (mod p^2).

Original entry on oeis.org

2, 3, 11, 107, 4931
Offset: 1

Views

Author

Pavlos Saridis (pavlos19(AT)yahoo.com), Sep 13 2003

Keywords

Comments

These are generalized Wilson primes of order 2. Similarly to Wilson's theorem which states that (p-1)! == -1 (mod p) for every prime p>=n, we can prove that (n-1)!(p-n)! == (-1)^n (mod p) for every prime p. Generalized Wilson primes p of order n satisfy the recurrence (n-1)!(p-n)! == (-1)^n (mod p^2). Cf. A128666
Also, near-Wilson primes with Wilson quotient modulo p equals 1: prime p=prime(n) is in this sequence iff A002068(n) == A007619(n) == 1 (mod p).
Zhi-Wei SUN conjectures that for n>1, a(n) == 3 (mod 8). (Posting to the Number Theory Mailing List, Nov 02 2009; added by N. J. A. Sloane, Nov 02 2009)
No other terms below 4*10^11.
Conjecture: primes p such that Sum_{k=1..p-1} k^(1-p) == -1 (mod p^2) are the odd terms of this sequence. - Thomas Ordowski, Jul 02 2020

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[700]],Mod[(#-2)!,#^2]==1&] (* Harvey P. Dale, Jun 01 2014 *)
  • PARI
    forprime(n=2, 10^9, if(Mod((n-2)!, n^2)==1, print1(n, ", "))) \\ Felix Fröhlich, Jun 17 2014

Extensions

Edited by Max Alekseyev, Jan 28 2012

A152413 Generalized Wilson primes of order 17; or primes p such that p^2 divides 16!(p-17)! + 1.

Original entry on oeis.org

61, 251, 479
Offset: 1

Views

Author

Alexander Adamchuk, Dec 03 2008

Keywords

Comments

Wilson's theorem states that (p-1)! == -1 (mod p) for every prime p. Wilson primes are the primes p such that p^2 divides (p-1)! + 1. They are listed in A007540. Wilson's theorem can be expressed in general as (n-1)!(p-n)! == (-1)^n (mod p) for every prime p >= n. Generalized Wilson primes order n are the primes p such that p^2 divides (n-1)!(p-n)! - (-1)^n.
Alternatively, prime p=prime(k) is a generalized Wilson prime order n iff A002068(k) == A007619(k) == H(n-1) (mod p), where H(n-1) = A001008(n-1)/A002805(n-1) is (n-1)-st harmonic number. For this sequence (n=17), it reduces to A002068(k) == A007619(k) == 2436559/720720 (mod p).

Crossrefs

Extensions

Edited by Max Alekseyev, Jan 28 2012

A282063 A(n, k) = k-th Wilson prime p of order n with p >= n and k running over the positive integers. Square array read by antidiagonals.

Original entry on oeis.org

5, 13, 2, 563, 3, 7
Offset: 1

Views

Author

Felix Fröhlich, Feb 05 2017

Keywords

Comments

A Wilson prime of order n is a prime p such that (n-1)!*(p-n)!-(-1)^n == 0 (modulo p^2).

Examples

			Array A(n, k) starts:
      5,   13,  563
      2,    3,   11,  107, 4931
      7
  10429
      5,    7,   47
     11
		

Crossrefs

Cf. A007540 (row 1), A079853 (row 2), A152413 (row 17), A128666 (column 1).

Programs

  • PARI
    is_wilson(n, order) = Mod((order-1)!*(n-order)!-(-1)^order, n^2)==0
    table(rows, cols) = for(x=1, rows, my(i=0); forprime(p=x, , if(is_wilson(p, x), print1(p, ", "); i++; if(i==cols, print(""); break))))
    table(4, 3) \\ print initial 4 rows and 3 columns of table
Showing 1-3 of 3 results.