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.
%I A007540 M3838 #140 Apr 25 2025 04:27:40 %S A007540 5,13,563 %N A007540 Wilson primes: primes p such that (p-1)! == -1 (mod p^2). %C A007540 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. %C A007540 Sequence is believed to be infinite. Next term is known to be > 2*10^13 (cf. Costa et al., 2013). %C A007540 Intersection of the Wilson numbers A157250 and the primes A000040. - _Jonathan Sondow_, Mar 04 2016 %C A007540 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 %C A007540 From _Felix Fröhlich_, Nov 16 2018: (Start) %C A007540 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). %C A007540 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) %C A007540 From _Amiram Eldar_, Jun 16 2021: (Start) %C A007540 Named after the English mathematician John Wilson (1741-1793) after whom "Wilson's theorem" was also named. %C A007540 The primes 5 and 13 appear in an exercise involving the Wilson congruence in Mathews (1892). [Edited by _Felix Fröhlich_, Jul 23 2021] %C A007540 Beeger found that there are no other smaller terms up to 114 (1913) and up to 200 (1930). %C A007540 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) %D A007540 N. G. W. H. Beeger, On the Congruence (p-1)! == -1 (mod p^2), Messenger of Mathematics, Vol. 49 (1920), pp. 177-178. %D A007540 Albert H. Beiler, Recreations in the Theory of Numbers, Dover, NY, 1964, p. 52. %D A007540 Calvin C. Clawson, Mathematical Mysteries, Plenum Press, 1996, p. 180. %D A007540 Richard Crandall and Carl Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see p. 29. %D A007540 G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, th. 80. %D A007540 G. B. Mathews, Theory of Numbers Part I., Cambridge: Deighton, Bell and Co., London: George Bell and Sons, 1892, page 318. %D A007540 Paulo Ribenboim, My Numbers, My Friends: Popular Lectures on Number Theory, Springer Science & Business Media, 2000, ISBN 0-387-98911-0. %D A007540 Paulo Ribenboim, The Book of Prime Number Records. Springer-Verlag, NY, 2nd ed., 1989, p. 277. %D A007540 Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 234-235. %D A007540 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %D A007540 Ilan Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 73. %D A007540 David Wells, The Penguin Dictionary of Curious and Interesting Numbers, Penguin Books, NY, 1986, p. 163. %H A007540 N. G. W. H. Beeger, <a href="https://archive.org/details/messengerofmathe43cambuoft/page/72">Quelques remarques sur les congruences r^(p-1) == 1 (mod p^2) et (p- 1)! == -1 (mod p^2)</a>, The Messenger of Mathematics, Vol. 43 (1913), pp. 72-84. %H A007540 Edgar Costa, Robert Gerbicz and David Harvey, <a href="https://doi.org/10.1090/S0025-5718-2014-02800-7">A search for Wilson primes</a>, Mathematics of Computation, Vol. 83, No. 290 (2014), pp. 3071-3091; <a href="http://arxiv.org/abs/1209.3436">arXiv preprint</a>, arXiv:1209.3436 [math.NT], 2012. %H A007540 R. Crandall, K. Dilcher and C. Pomerance, <a href="https://doi.org/10.1090/S0025-5718-97-00791-6">A search for Wieferich and Wilson primes</a>, Mathematics of Computation, 66 (1997), 433-449. %H A007540 Karl Goldberg, <a href="https://doi.org/10.1112/jlms/s1-28.2.252">A Table of Wilson Quotients and the Third Wilson Prime</a>, Journal of the London Mathematical Society, Vol. 28 (1953), pp. 252-256. %H A007540 James Grime and Brady Haran, <a href="https://www.youtube.com/watch?v=eZUa5k_VIZg">What do 5, 13 and 563 have in common?</a>, YouTube video (2014). %H A007540 Emma Lehmer, <a href="http://www.jstor.org/stable/2300697">A Note on Wilson's Quotient</a>, The American Mathematical Monthly, Vol. 44, No. 4 (1937), pp. 237-238. %H A007540 Emma Lehmer, <a href="https://www.jstor.org/stable/2301133">On the Congruence (p-1)! == -1 (mod p^2)</a>, The American Mathematical Monthly, Vol. 44, No. 7 (1937), p. 462. %H A007540 Emma Lehmer, <a href="https://www.jstor.org/stable/1968791">On congruences involving Bernoulli numbers and the quotients of Fermat and Wilson"</a>, Annals of Mathematics, Vol. 39, No. 2 (1938), pp. 350-360. %H A007540 George Ballard Mathews, <a href="https://archive.org/details/theoryofnumbersp00math/page/318/">Theory of numbers, Part I</a>, Cambridge, 1892, p. 318. %H A007540 Tapio Rajala, <a href="http://users.jyu.fi/~tamaraja/Wilson.html">Status of a search for Wilson primes</a> %H A007540 Maxie D. Schmidt, <a href="https://arxiv.org/abs/1701.04741">New Congruences and Finite Difference Equations for Generalized Factorial Functions</a>, arXiv:1701.04741 [math.CO], 2017. %H A007540 Jonathan Sondow, <a href="https://doi.org/10.1007/978-1-4939-1601-6_17">Lerch Quotients, Lerch Primes, Fermat-Wilson Quotients, and the Wieferich-Non-Wilson Primes 2, 3, 14771</a>, In: M. B. Nathanson, Combinatorial and Additive Number Theory, Springer, CANT 2011 and 2012. Also <a href="https://arxiv.org/abs/1110.3113">on arXiv</a>, arXiv:1110.3113 [math.NT], 2011-2012. %H A007540 Apoloniusz Tyszka, <a href="https://philarchive.org/rec/TYSDAS">On sets X subset of N for which we know an algorithm that computes a threshold number t(X) in N such that X is infinite if and only if X contains an element greater than t(X)</a>, 2019. %H A007540 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/WilsonPrime.html">Wilson Prime</a>. %H A007540 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/IntegerSequencePrimes.html">Integer Sequence Primes</a>. %H A007540 Wikipedia, <a href="https://en.wikipedia.org/wiki/Wilson_prime">Wilson prime</a>. %H A007540 Paul Zimmermann, <a href="https://members.loria.fr/PZimmermann/records/primes.html">Records for prime numbers</a>. %t A007540 Select[Prime[Range[500]], Mod[(# - 1)!, #^2] == #^2 - 1 &] (* _Harvey P. Dale_, Mar 30 2012 *) %o A007540 (PARI) forprime(n=2, 10^9, if(Mod((n-1)!, n^2)==-1, print1(n, ", "))) \\ _Felix Fröhlich_, Apr 28 2014 %o A007540 (PARI) is(n)=prod(k=2,n-1,k,Mod(1,n^2))==-1 \\ _Charles R Greathouse IV_, Aug 03 2014 %o A007540 (Python) %o A007540 from sympy import prime %o A007540 A007540_list = [] %o A007540 for n in range(1,10**4): %o A007540 p, m = prime(n), 1 %o A007540 p2 = p*p %o A007540 for i in range(2,p): %o A007540 m = (m*i) % p2 %o A007540 if m == p2-1: %o A007540 A007540_list.append(p) # _Chai Wah Wu_, Dec 04 2014 %Y A007540 Cf. A007619, A157249, A157250, A377266. %K A007540 nonn,hard,more,bref,nice %O A007540 1,1 %A A007540 _N. J. A. Sloane_