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

A092029 Duplicate of A050299.

Original entry on oeis.org

1, 5, 7, 11, 29, 773, 1321, 2621
Offset: 1

Views

Author

Keywords

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

A163212 Wilson quotients (A007619) which are primes.

Original entry on oeis.org

5, 103, 329891, 10513391193507374500051862069
Offset: 1

Views

Author

Peter Luschny, Jul 24 2009

Keywords

Comments

a(5) = A007619(137), a(6) = A007619(216), a(7) = A007619(381).
Same as A122696 without its initial term 2. - Jonathan Sondow, May 19 2013

Examples

			The quotient (720+1)/7 = 103 is a Wilson quotient and a prime, so 103 is a member.
		

Crossrefs

Programs

  • Maple
    # WQ defined in A163210.
    A163212 := n -> select(isprime,WQ(factorial,p->1,n)):
  • Mathematica
    Select[Table[p = Prime[n]; ((p-1)!+1)/p, {n, 1, 15}], PrimeQ] (* Jean-François Alcover, Jun 28 2013 *)
  • PARI
    forprime(p=2, 1e4, a=((p-1)!+1)/p; if(ispseudoprime(a), print1(a, ", "))) \\ Felix Fröhlich, Aug 03 2014

Formula

a(n) = A122696(n+1) = A007619(A225906(n)) = ((A050299(n+1)-1)!+1)/A050299(n+1). - Jonathan Sondow, May 19 2013

A122696 Primes of the form ((k-1)! + 1)/k.

Original entry on oeis.org

2, 5, 103, 329891, 10513391193507374500051862069
Offset: 1

Views

Author

Alexander Adamchuk, Sep 22 2006

Keywords

Comments

A163212, Wilson quotients (A007619: ((p-1)!+1)/p) which are primes, is a subsequence. Corresponding numbers n such that ((n-1)! + 1)/n is prime are listed in A050299 = {1, 5, 7, 11, 29, 773, 1321, 2621, ...}. a(6) has 1893 digits. a(7) has 3545 digits. a(8) has 7817 digits.
Except for a(1) = 2, same as A163212. - Jonathan Sondow, May 20 2013

Crossrefs

A050299 is the main entry for this sequence.

Programs

  • Mathematica
    Select[Table[((k-1)!+1)/k,{k,30}],PrimeQ] (* James C. McMahon, Nov 09 2024 *)
  • PARI
    is(n)=isprime(((n-1)!+1)/n) \\ Anders Hellström, Nov 22 2015 \\ This program actually produces A050299 - Michel Marcus, Aug 02 2016
    
  • PARI
    for(n=1, 1e2, if(((n-1)!+1)%n==0 && isprime(k=((n-1)!+1)/n), print1(k, ", "))) \\ Altug Alkan, Nov 22 2015

Formula

a(n) = A163212(n-1) = ((A050299(n)-1)! + 1)/A050299(n). - Jonathan Sondow, May 19 2013

Extensions

The next term is too large to include.
a(4) and first comment corrected by Gionata Neri, Aug 02 2016

A084750 Numbers k such that k! - p is a prime, where p is the smallest prime > k.

Original entry on oeis.org

4, 5, 10, 11, 12, 14, 29, 53, 81, 90, 116, 236, 323, 346, 1172, 2957, 8400, 14906
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 16 2003

Keywords

Comments

Numbers k such that k! - NextPrime(k) is prime.
If k != 3, there does not exist a prime p and a number k such that k! - NextPrime(k) < p < k! - 1. - Farideh Firoozbakht, Feb 26 2004

Examples

			10 is in the sequence because 10! = 3628800, NextPrime(10) = 11 and 3628800 - 11 = 3628789 is prime.
		

Crossrefs

Programs

  • Mathematica
    Do[If[PrimeQ[k!-NextPrime[k]], Print[k]], {k, 0, 1425}] (* Farideh Firoozbakht, Feb 26 2004 *)

Extensions

More terms from Farideh Firoozbakht, Feb 26 2004
a(16) from Ryan Propper, Jul 09 2005
Edited by N. J. A. Sloane at the suggestion of Ryan Propper, Jan 26 2008
a(17) from Michael S. Branicky, Jun 21 2023
a(18) from Michael S. Branicky, Apr 28 2025

A225906 Indices of primes whose Wilson quotients are also prime.

Original entry on oeis.org

3, 4, 5, 10, 137, 216, 381
Offset: 1

Views

Author

Jonathan Sondow, May 20 2013

Keywords

Comments

Is it a coincidence that the terms are alternately odd and even? Is it also a coincidence that the odd terms are all primes (= A225672)?

Examples

			The Wilson quotient of 7 is ((7-1)!+1)/7 = 103, which is prime, and 7 is the 4th prime, so 4 is a member.
		

Crossrefs

Formula

a(n) = A000720(A050299(n+1)).

A225672 Primes p such that the Wilson quotient of the p-th prime is also prime.

Original entry on oeis.org

3, 5, 137, 381
Offset: 1

Views

Author

Jonathan Sondow, May 20 2013

Keywords

Examples

			The 5th prime is 11 and the Wilson quotient of 11 is ((11-1)!+1)/11 = 329891, which is prime, so 5 is a term.
		

Crossrefs

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
Showing 1-8 of 8 results.