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.

A002981 Numbers k such that k! + 1 is prime.

Original entry on oeis.org

0, 1, 2, 3, 11, 27, 37, 41, 73, 77, 116, 154, 320, 340, 399, 427, 872, 1477, 6380, 26951, 110059, 150209, 288465, 308084, 422429
Offset: 1

Views

Author

Keywords

Comments

If n + 1 is prime then (by Wilson's theorem) n + 1 divides n! + 1. Thus for n > 2 if n + 1 is prime n is not in the sequence. - Farideh Firoozbakht, Aug 22 2003
For n > 2, n! + 1 is prime <==> nextprime((n+1)!) > (n+1)nextprime(n!) and we can conjecture that for n > 2 if n! + 1 is prime then (n+1)! + 1 is not prime. - Mohammed Bouayoun (bouyao(AT)wanadoo.fr), Mar 03 2004
The prime members are in A093804 (numbers n such that Sum_{d|n} d! is prime) since Sum_{d|n} d! = n! + 1 if n is prime. - Jonathan Sondow
150209 is also in the sequence, cf. the link to Caldwell's prime pages. - M. F. Hasler, Nov 04 2011

Examples

			3! + 1 = 7 is prime, so 3 is in the sequence.
		

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 116, p. 40, Ellipses, Paris 2008.
  • Harvey Dubner, Factorial and primorial primes, J. Rec. Math., 19 (No. 3, 1987), 197-203.
  • Richard K. Guy, Unsolved Problems in Number Theory, Section A2.
  • F. Le Lionnais, Les Nombres Remarquables, Paris, Hermann, 1983, p. 100.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 118.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 70.

Crossrefs

Cf. A002982 (n!-1 is prime), A064295. A088332 gives the primes.
Equals A090660 - 1.
Cf. A093804.

Programs

  • Magma
    [n: n in [0..800] | IsPrime(Factorial(n)+1)]; // Vincenzo Librandi, Oct 31 2018
    
  • Mathematica
    v = {0, 1, 2}; Do[If[ !PrimeQ[n + 1] && PrimeQ[n! + 1], v = Append[v, n]; Print[v]], {n, 3, 29651}]
    Select[Range[100], PrimeQ[#! + 1] &] (* Alonso del Arte, Jul 24 2014 *)
  • PARI
    for(n=0,500,if(ispseudoprime(n!+1),print1(n", "))) \\ Charles R Greathouse IV, Jun 16 2011
    
  • Python
    from sympy import factorial, isprime
    for n in range(0,800):
        if isprime(factorial(n)+1):
            print(n, end=', ') # Stefano Spezia, Jan 10 2019

Extensions

a(19) sent in by Jud McCranie, May 08 2000
a(20) from Ken Davis (kraden(AT)ozemail.com.au), May 24 2002
a(21) found by PrimeGrid around Jun 11 2011, submitted by Eric W. Weisstein, Jun 13 2011
a(22) from Rene Dohmen, Jun 09 2012
a(23) from Rene Dohmen, Jan 12 2022
a(24)-a(25) from Dmitry Kamenetsky, Jun 19 2024

A139159 a(n) = prime(n)! + 1.

Original entry on oeis.org

3, 7, 121, 5041, 39916801, 6227020801, 355687428096001, 121645100408832001, 25852016738884976640001, 8841761993739701954543616000001, 8222838654177922817725562880000001, 13763753091226345046315979581580902400000001, 33452526613163807108170062053440751665152000000001
Offset: 1

Views

Author

Artur Jasinski, Apr 11 2008

Keywords

Crossrefs

Programs

Formula

a(n) = A039716(n) + 1. - Michel Marcus, Nov 08 2013

Extensions

More terms from Michel Marcus, Aug 10 2025

A103317 Primes p such that p! - 1 is also prime.

Original entry on oeis.org

3, 7, 379, 6917, 208003
Offset: 1

Views

Author

Jonathan Sondow, Jan 31 2005

Keywords

Comments

The members are the primes in A002982 (n! - 1 is prime).

Examples

			3 is prime and 3! - 1 = 5 is prime, so 3 is a member.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, Section A2.

Crossrefs

Programs

Extensions

a(5)=208003 (found on Jul 27 2016, by Sou Fukui), added by Jinyuan Wang, Jan 20 2020

A163079 Primes p such that p$ + 1 is also prime. Here '$' denotes the swinging factorial function (A056040).

Original entry on oeis.org

2, 3, 5, 31, 67, 139, 631, 9743, 16253, 17977, 27901, 37589
Offset: 1

Views

Author

Peter Luschny, Jul 21 2009

Keywords

Comments

a(n) are the primes in A163077.

Examples

			5 is prime and 5$ + 1 = 30 + 1 = 31 is prime, so 5 is in the sequence.
		

Crossrefs

Programs

  • Maple
    a := proc(n) select(isprime,select(k -> isprime(A056040(k)+1),[$0..n])) end:
  • Mathematica
    f[n_] := 2^(n - Mod[n, 2])*Product[k^((-1)^(k + 1)), {k, n}]; p = 2; lst = {}; While[p < 38000, a = f@p + 1; If[ PrimeQ@a, AppendTo[ lst, p]; Print@p]; p = NextPrime@p]; lst (* Robert G. Wilson v, Aug 08 2010 *)
  • PARI
    is(k) = isprime(k) && ispseudoprime(1+k!/(k\2)!^2); \\ Jinyuan Wang, Mar 22 2020

Extensions

a(8)-a(12) from Robert G. Wilson v, Aug 08 2010

A103319 Primes of the form p! + 1 where p is prime.

Original entry on oeis.org

3, 7, 39916801, 13763753091226345046315979581580902400000001, 33452526613163807108170062053440751665152000000001, 4470115461512684340891257138125051110076800700282905015819080092370422104067183317016903680000000000000001
Offset: 1

Views

Author

Jonathan Sondow, Jan 31 2005

Keywords

Comments

The values of p are 2, 3, 11, 37, 41, 73 which is A093804 (with a different definition). Subsequence of A088332 (primes of the form n! + 1).

Examples

			2 and 2! + 1 = 3 are prime, so 3 is a member.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, Section A2.

Crossrefs

Programs

  • Mathematica
    Select[Table[p!+1,{p,Prime[Range[30]]}],PrimeQ] (* Harvey P. Dale, Nov 28 2019 *)
Showing 1-5 of 5 results.