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-5 of 5 results.

A157250 Wilson numbers: k such that the generalized Wilson quotient A157249(k) is divisible by k.

Original entry on oeis.org

1, 5, 13, 563, 5971, 558771, 1964215, 8121909, 12326713, 23025711, 26921605, 341569806, 399292158
Offset: 1

Views

Author

Jonathan Sondow and Wadim Zudilin, Feb 27 2009

Keywords

Comments

A prime p is a Wilson prime if p divides its Wilson quotient A007619. A number n is a Wilson number if n divides its generalized Wilson quotient A157249.
The sequence contains all Wilson numbers <= 5 x 10^8. Heuristics suggest that #(Wilson numbers < N) is about (6/pi^2) log N, for large N.
A Wilson number is prime if and only if it is a Wilson prime A007540. Only three are known: 5, 13, 563.
The first composite Wilson number 5971 was discovered by Kloss, the others by Agoh, Dilcher, and Skula. Every known composite Wilson number n has at least two odd prime factors, so e(n) = -1.
For additional references and links, see A007540.

Examples

			A157249(13) = (A001783(13) + e(13))/13 = ((13-1)! + 1)/13 = 479001601/13 = 36846277 == 0 mod 13, so 13 is a member. A001783(5971) + e(5971) = A001783(5971) - 1 == 0 mod 5971^2, so 5971 is a member. But A157249(8) = (A001783(8) + e(8))/8 = (3*5*7 - 1)/8 = 13 ==/== 0 mod 8, so 8 is not a member.
		

References

  • L. E. Dickson, History of the Theory of Numbers, vol. 1, Divisibility and Primality, Chelsea, New York, 1966, p. 65.

Crossrefs

Cf. Wilson quotient A007619, Wilson prime A007540, generalized Wilson quotient A157249, n-phi-torial A001783, numbers having a primitive root A033948.

Programs

  • Mathematica
    f[n_] := Times @@ Select[Range[n], CoprimeQ[n, #]&];
    e[1|2|4] = 1; e[n_] := If[MatchQ[FactorInteger[n], {{?OddQ, }} | {{2, 1}, {, }}], 1, -1];
    WilsonQ[n_] := IntegerQ[(f[n] + e[n])/n^2];
    Reap[For[k = 1, k < 10^7, k++, If[WilsonQ[k], Print[k]; Sow[k]]]][[2, 1]] (* Jean-François Alcover, Dec 11 2018 *)

Formula

A157249(n) == 0 mod n.
A001783(n) + e(n) == 0 mod n^2, where e(n) = +1 or -1 according as n does or does not have a primitive root.

A317507 Numbers k whose generalized Wilson quotient A157249(k) is prime.

Original entry on oeis.org

1, 5, 7, 8, 10, 11, 29, 62, 486, 614, 773, 1321, 1906, 2621
Offset: 1

Views

Author

Amiram Eldar, Sep 29 2018

Keywords

Comments

The corresponding primes are 2, 5, 103, 13, 19, 329891, ...
Supersequence of A050299 (except for 1, the prime terms of this sequence).
No more terms below 10^4.

Crossrefs

Programs

  • Mathematica
    p[n_] := Times @@ Select[Range[n], CoprimeQ[n, #] &]; e[1 | 2 | 4] = 1; e[n_] := (fi = FactorInteger[n]; If[MatchQ[fi, {{(p_)?OddQ, }} | {{2, 1}, {, }}], 1, -1]); a[n] := (p[n] + e[n])/n; n = 1; s={}; Do[If[PrimeQ[a[n]], AppendTo[s,n]], {n, 1, 1000}]; s (* after Jean-François Alcover at A157249 *)
  • PARI
    phito(n) = prod(k=2, n-1, k^(gcd(k, n)==1)); \\ A001783
    is(n) = if(n%2, isprimepower(n) || n==1, n==2 || n==4 || (isprimepower(n/2, &n) && n>2)); \\ A033948
    e(n) = if (is(n), 1, -1);
    gw(n) = (phito(n)+e(n))/n;
    isok(n) = isprime(gw(n)); \\ Michel Marcus, Oct 28 2018

A007619 Wilson quotients: ((p-1)! + 1)/p where p is the n-th prime.

Original entry on oeis.org

1, 1, 5, 103, 329891, 36846277, 1230752346353, 336967037143579, 48869596859895986087, 10513391193507374500051862069, 8556543864909388988268015483871, 10053873697024357228864849950022572972973, 19900372762143847179161250477954046201756097561, 32674560877973951128910293168477013254334511627907
Offset: 1

Views

Author

Keywords

Comments

Suggested by the Wilson-Lagrange Theorem: An integer p > 1 is a prime if and only if (p-1)! == -1 (mod p).
Define b(n) = ((n-1)*(n^2 - 3*n + 1)*b(n-1) - (n-2)^3*b(n-2) )/(n*(n-3)); b(2) = b(3) = 1; sequence gives b(primes).
Subsequence of the generalized Wilson quotients A157249. - Jonathan Sondow, Mar 04 2016
a(n) is an integer because of to Wilson's theorem (Theorem 80, p. 68, the if part of Theorem 81, p. 69, given in Hardy and Wright). See the first comment. `This theorem is of course quite useless as a practical test for the primality of a given number n' ( op. cit., p. 69). - Wolfdieter Lang, Oct 26 2017

Examples

			The 4th prime is 7, so a(4) = (6! + 1)/7 = 103.
		

References

  • R. Crandall and C. Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see p. 29.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, fifth edition, Oxford Science Publications, Clarendon Press, Oxford, 2003.
  • Paulo Ribenboim, The Book of Prime Number Records. Springer-Verlag, NY, 2nd ed., 1989, p. 277.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 234.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A005450, A005451, A007540 (Wilson primes), A050299, A163212, A225672, A225906.
Cf. A261779.
Cf. A157249, A157250, A292691 (twin prime analog quotient).

Programs

Formula

a(n) = A157249(prime(n)). - Jonathan Sondow, Mar 04 2016

Extensions

Definition clarified by Jonathan Sondow, Aug 05 2011

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

Original entry on oeis.org

5, 13, 563
Offset: 1

Views

Author

Keywords

Comments

Suggested by the Wilson-Lagrange Theorem: An integer p > 1 is a prime if and only if (p-1)! == -1 (mod p). Cf. Wilson quotients, A007619.
Sequence is believed to be infinite. Next term is known to be > 2*10^13 (cf. Costa et al., 2013).
Intersection of the Wilson numbers A157250 and the primes A000040. - Jonathan Sondow, Mar 04 2016
Conjecture: Odd primes p such that 1^(p-1) + 2^(p-1) + ... + (p-1)^(p-1) == p-1 (mod p^2). - Thomas Ordowski and Giovanni Resta, Jul 25 2018
From Felix Fröhlich, Nov 16 2018: (Start)
Harry S. Vandiver apparently said about the Wilson primes "It is not known if there are infinitely many Wilson primes. This question seems to be of such a character that if I should come to life any time after my death and some mathematician were to tell me that it had definitely been settled, I think I would immediately drop dead again." (cf. Ribenboim, 2000, p. 217).
Let p be a Wilson prime and let i be the index of p in A000040. For n = 1, 2, 3, the values of i are 3, 6, 103. The primes among those values are Lerch primes, i.e., terms of A197632. Is this a property that necessarily follows if i is prime (cf. Sondow, 2011/2012, 2.5 Open Problems 5)? (End)
From Amiram Eldar, Jun 16 2021: (Start)
Named after the English mathematician John Wilson (1741-1793) after whom "Wilson's theorem" was also named.
The primes 5 and 13 appear in an exercise involving the Wilson congruence in Mathews (1892). [Edited by Felix Fröhlich, Jul 23 2021]
Beeger found that there are no other smaller terms up to 114 (1913) and up to 200 (1930).
a(3) = 563 was found by Goldberg (1953), who used the Bureau of Standards Eastern Automatic Computer (SEAC) to search all primes less than 10000. According to Goldberg, the third prime was discovered independently by Donald Wall six month later. (End)

References

  • N. G. W. H. Beeger, On the Congruence (p-1)! == -1 (mod p^2), Messenger of Mathematics, Vol. 49 (1920), pp. 177-178.
  • Albert H. Beiler, Recreations in the Theory of Numbers, Dover, NY, 1964, p. 52.
  • Calvin C. Clawson, Mathematical Mysteries, Plenum Press, 1996, p. 180.
  • Richard Crandall and Carl Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see p. 29.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, th. 80.
  • G. B. Mathews, Theory of Numbers Part I., Cambridge: Deighton, Bell and Co., London: George Bell and Sons, 1892, page 318.
  • Paulo Ribenboim, My Numbers, My Friends: Popular Lectures on Number Theory, Springer Science & Business Media, 2000, ISBN 0-387-98911-0.
  • Paulo Ribenboim, The Book of Prime Number Records. Springer-Verlag, NY, 2nd ed., 1989, p. 277.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 234-235.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Ilan Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 73.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers, Penguin Books, NY, 1986, p. 163.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[500]], Mod[(# - 1)!, #^2] == #^2 - 1 &] (* Harvey P. Dale, Mar 30 2012 *)
  • PARI
    forprime(n=2, 10^9, if(Mod((n-1)!, n^2)==-1, print1(n, ", "))) \\ Felix Fröhlich, Apr 28 2014
    
  • PARI
    is(n)=prod(k=2,n-1,k,Mod(1,n^2))==-1 \\ Charles R Greathouse IV, Aug 03 2014
    
  • Python
    from sympy import prime
    A007540_list = []
    for n in range(1,10**4):
        p, m = prime(n), 1
        p2 = p*p
        for i in range(2,p):
            m = (m*i) % p2
        if m == p2-1:
            A007540_list.append(p) # Chai Wah Wu, Dec 04 2014

A377266 Primes p with the property that there exist nonnegative integers m,n such that m!*n! is congruent to either +1 or -1 mod p^2, with m + n = p - 1.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 31, 47, 53, 59, 61, 71, 107, 137, 149, 173, 227, 251, 277, 313, 347, 349, 359, 367, 373, 409, 419, 443, 463, 467, 479, 491, 499, 521, 523, 541, 563, 577, 599, 607, 613, 617, 631, 643, 647, 677, 683, 739, 751, 757, 809, 811, 821, 823, 827, 829
Offset: 1

Views

Author

Richard Peterson, Oct 22 2024

Keywords

Comments

The generalization of Wilson's Theorem that x!*(p-1-x)! is either +1 or -1 mod p when p is prime is known. This is investigated here for cases of p such that there is an x with x!*(p-1-x)! congruent to either +1 or -1 mod p^2.

Examples

			0!*4! + 1 = 5^2 and 4+0 = 5-1, so 5 is in the sequence.
1!*9! - 1 = 11^2*2999 and 1+9 = 10-1, so 11 is in the sequence.
0!*12! + 1 = 13^2*2834329 and 0+12 = 13-1, so 13 is in the sequence.
10!*6! + 1 = 17^2*83*108923 and 10+6=17-1, so 17 is in the sequence.
19!*39!-1 is divisible by 59^2 and 19+39=59-1, so 59 is in the sequence.
		

Crossrefs

A007540 is a subsequence.

Programs

  • Maple
    filter:= proc(p) local m,n,A,v;
      A:= Array(0..p);
      A[0]:= 1:
      for n from 1 to p do A[n]:= n*A[n-1] mod p^2 od:
      for m from 0 to (p-1)/2 do
        v:= A[m] * A[p-1-m] mod p^2;
        if v = 1 or v = p^2-1 then return true fi;
      od;
      false
    end proc:
    select(filter, [seq(ithprime(i),i=1..150)]); # Robert Israel, Dec 30 2024
  • PARI
    isok(p)={if(isprime(p), for(m=0, p\2, my(t=(m!*(p-1-m)!%p^2)); if(t==1||t==p^2-1, return(1)))); 0} \\ Andrew Howroyd, Oct 22 2024

Extensions

a(14) onwards from Andrew Howroyd, Oct 22 2024
Showing 1-5 of 5 results.