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-10 of 19 results. Next

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

A002982 Numbers k such that k! - 1 is prime.

Original entry on oeis.org

3, 4, 6, 7, 12, 14, 30, 32, 33, 38, 94, 166, 324, 379, 469, 546, 974, 1963, 3507, 3610, 6917, 21480, 34790, 94550, 103040, 147855, 208003
Offset: 1

Views

Author

Keywords

Comments

The corresponding primes n!-1 are often called factorial primes.

Examples

			From _Gus Wiseman_, Jul 04 2019: (Start)
The sequence of numbers n! - 1 together with their prime indices begins:
                    1: {}
                    5: {3}
                   23: {9}
                  119: {4,7}
                  719: {128}
                 5039: {675}
                40319: {9,273}
               362879: {5,5,430}
              3628799: {10,11746}
             39916799: {6,7,9,992}
            479001599: {25306287}
           6227020799: {270,256263}
          87178291199: {3610490805}
        1307674367999: {7,11,11,16,114905}
       20922789887999: {436,318519035}
      355687428095999: {8,21,10165484947}
     6402373705727999: {17,20157,25293727}
   121645100408831999: {119,175195,4567455}
  2432902008176639999: {11715,659539127675}
(End)
		

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 166, p. 53, Ellipses, Paris 2008.
  • R. K. Guy, Unsolved Problems in Number Theory, Section A2.
  • 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 entry 719 at p. 160.

Crossrefs

Cf. A002981 (numbers n such that n!+1 is prime).
Cf. A055490 (primes of form n!-1).
Cf. A088332 (primes of form n!+1).

Programs

Extensions

21480 sent in by Ken Davis (ken.davis(AT)softwareag.com), Oct 29 2001
Updated Feb 26 2007 by Max Alekseyev, based on progress reported in the Carmody web site.
Inserted missing 21480 and 34790 (see Caldwell). Added 94550, discovered Oct 05 2010. Eric W. Weisstein, Oct 06 2010
103040 was discovered by James Winskill, Dec 14 2010. It has 471794 digits. Corrected by Jens Kruse Andersen, Mar 22 2011
a(26) = 147855 from Felix Fröhlich, Sep 02 2013
a(27) = 208003 from Sou Fukui, Jul 27 2016

A117141 Primes of the form n!! - 1.

Original entry on oeis.org

2, 7, 47, 383, 10321919, 51011754393599, 1130138339199322632554990773529330319359999999, 73562883979319395645666688474019139929848516028923903999999999, 4208832729023498248022825567687608993477547383960134557368319999999999
Offset: 1

Views

Author

Keywords

Examples

			6!! - 1 = 6*4*2 - 1 = 48 - 1 = 47, which is prime.
8!! - 1 = 8*6*4*2 - 1 = 384 - 1 = 383, which is prime.
		

References

  • G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 158.

Crossrefs

Cf. A093173 = primes of the form (2^n * n!) - 1.

Programs

  • Maple
    SFACT:= proc(n) local i,j,k; for k from 1 by 1 to n do i:=k; j:=k-2; while j >0 do i:=i*j; j:=j-2; od: if isprime(i-1) then print(i-1); fi; od: end: SFACT(100);
  • Mathematica
    lst={};Do[p=n!!-1;If[PrimeQ[p],AppendTo[lst,p]],{n,0,5!,1}];lst (* Vladimir Joseph Stephan Orlovsky, Jan 27 2009 *)
    Select[Table[n!!-1,{n,1,100}],PrimeQ] (* Vincenzo Librandi, Dec 07 2011 *)
  • PARI
    print1(2);for(n=1, 1e3, if(ispseudoprime(t=n!<Charles R Greathouse IV, Jun 16 2011

Formula

a(n) = A093173(n-1) for n > 1. - Alexander Adamchuk, Apr 18 2007
a(n) = A006882(A007749(n)) - 1. - Elmo R. Oliveira, Feb 22 2025

A104372 Primes of the form A104350(k) + 1.

Original entry on oeis.org

2, 3, 7, 13, 61, 181, 2521, 7561, 415801, 1247401, 1099944846001, 146100174169950001, 1156675078903494150001, 750321420485151941966263672363958662088980270355720625000001
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 06 2005

Keywords

Crossrefs

Intersection of A104365 and A000040.

Programs

  • Mathematica
    Select[FoldList[Times, Array[FactorInteger[#][[-1, 1]] &, 100]] + 1, PrimeQ] (* Amiram Eldar, Apr 08 2024 *)
  • PARI
    gpf(n) = {my(p = factor(n)[, 1]); if(n == 1, 1, p[#p]);}
    lista(nmax) = {my(r = 1); for(k = 1, nmax, r * = gpf(k); if(isprime(r+1), print1(r+1, ", ")));} \\ Amiram Eldar, Apr 08 2024

Extensions

a(14) from Amiram Eldar, Apr 09 2024

A125162 a(n) is the number of primes of the form k! + n, 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 4, 0, 1, 1, 5, 1, 3, 0, 1, 1, 6, 1, 7, 0, 1, 1, 6, 0, 1, 0, 1, 1, 6, 1, 9, 0, 0, 0, 3, 1, 11, 0, 1, 1, 9, 1, 5, 0, 1, 1, 10, 0, 2, 0, 1, 1, 9, 0, 2, 0, 1, 1, 10, 1, 9, 0, 0, 0, 3, 1, 9, 0, 1, 1, 8, 1, 9, 0, 0, 0, 5, 1, 9, 0, 1, 1, 11, 0, 1, 0, 1, 1, 8, 0, 3, 0, 0, 0, 2, 1, 10, 0, 1, 1, 10, 1
Offset: 1

Views

Author

Alexander Adamchuk, Nov 21 2006

Keywords

Comments

Note the triples of consecutive zeros in a(n) for n = {{32,33,34}, {62,63,64}, {74,75,76}, {92,93,94}, {116,117,118}, {122,123,124}, {140,141,142}, {152,153,154}, {158,159,160}, {182,183,184}, {200,201,202}, {206,207,208}, {212,213,214}, {218,219,220}, {242,243,244}, {272,273,274}, {284,285,286}, ...}. The middle index of most zero triples is a multiple of 3. See A125164.
The first consecutive quintuple of zeros has indices n = {294,295,296,297,298}, where the odd zero index n = 295 is not a multiple of 3.
Also for n >= 2, a(n) is the number of primes of the form k! + n for all k, since n divides k! + n for k >= n. Note that it is not known whether there are infinitely many primes of the form k! + 1; see A088332 for such primes and A002981 for the indices k. - Jianing Song, Jul 28 2018

Examples

			a(n) is the length of n-th row in the table of numbers k such that k! + n is a prime, 1 <= k <= n.
   n:  numbers k
   -------------
   1:  {1},
   2:  {1},
   3:  {2},
   4:  {1},
   5:  {2, 3, 4},
Thus a(1)-a(4) = 1, a(5) = 3.
See Example table link for more rows.
		

Crossrefs

Cf. A125163 (indices of 0), A125164 (triples).

Programs

  • Mathematica
    Table[Length[Select[Range[n],PrimeQ[ #!+n]&]],{n,1,300}]
  • PARI
    a(n)=c=0;for(k=1,n,if(ispseudoprime(k!+n),c++));c
    vector(100,n,a(n)) \\ Derek Orr, Oct 15 2014

Extensions

Name clarified by Jianing Song, Jul 28 2018
Edited by Michel Marcus, Jul 29 2018

A136437 a(n) = prime(n) - k! where k is the greatest number such that k! <= prime(n).

Original entry on oeis.org

0, 1, 3, 1, 5, 7, 11, 13, 17, 5, 7, 13, 17, 19, 23, 29, 35, 37, 43, 47, 49, 55, 59, 65, 73, 77, 79, 83, 85, 89, 7, 11, 17, 19, 29, 31, 37, 43, 47, 53, 59, 61, 71, 73, 77, 79, 91, 103, 107, 109, 113, 119, 121, 131, 137, 143, 149, 151, 157, 161, 163, 173, 187, 191, 193, 197, 211, 217, 227, 229, 233, 239, 247
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 02 2008

Keywords

Comments

How many times does each prime appear in this sequence?
The only value (prime(n) - k!) = 0 is at n=1, where k=2.
Are n=2, k=2 and n=4, k=3 the only occurrences of (prime(n) - k!) = 1?
There exist infinitely many solutions of the form (prime(n) - k!) = prime(n-t), t < n.
Are there infinitely many solutions of the form (prime(n) - k!) = prime(r_1)*...*prime(r_i); r_i < n for all i?
From Bernard Schott, Jul 16 2021: (Start)
Answer to the second question is no: 18 other occurrences (n,k) of (prime(n) - k!) = 1 are known today; indeed, every k > 1 in A002981 that satisfies k! + 1 is prime gives an occurrence, but only a third pair (n, k) is known exactly; and this comes for n = 2428957, k = 11 because (prime(2428957) - 11!) = 1.
The next occurrence corresponds to k = 27 and n = X where prime(X) = 1+27! = 10888869450418352160768000001 but index X is not yet available (see A062701).
For the occurrences of (prime(m) - k!) = 1, integers k are in A002981 \ {0, 1}, corresponding indices m are in A062701 \ {1} (only 3 indices are known today) and prime(m) are in A088332 \ {2}. (End)

Examples

			a(1)  = prime(1)  - 2! =  2 -  2 =  0;
a(2)  = prime(2)  - 2! =  3 -  2 =  1;
a(3)  = prime(3)  - 2! =  5 -  2 =  3;
a(4)  = prime(4)  - 3! =  7 -  6 =  1;
a(5)  = prime(5)  - 3! = 11 -  6 =  5;
a(6)  = prime(6)  - 3! = 13 -  6 =  7;
a(7)  = prime(7)  - 3! = 17 -  6 = 11;
a(8)  = prime(8)  - 3! = 19 -  6 = 13;
a(9)  = prime(9)  - 3! = 23 -  6 = 17;
a(10) = prime(10) - 4! = 29 - 24 =  5.
		

Crossrefs

Programs

  • Maple
    f:=proc(n) local p,i; p:=ithprime(n); for i from 0 to p do if i! > p then break; fi; od; p-(i-1)!; end;
    [seq(f(n),n=1..70)]; # N. J. A. Sloane, May 22 2012
  • Mathematica
    a[n_] := Module[{p, k},p = Prime[n];k = 1;While[Factorial[k] <= p, k++];p - Factorial[k - 1]] (* James C. McMahon, May 05 2025 *)
  • PARI
    a(n) = my(k=1, p=prime(n)); while (k! <= p, k++); p - (k-1)!; \\ Michel Marcus, Feb 19 2019

Formula

a(n) = prime(n)- k! where k is the greatest number for which k! <= prime(n).
a(n) = A212598(prime(n)). - Michel Marcus, Feb 19 2019
a(n) = A000040(n) - A346425(n). - Bernard Schott, Jul 16 2021

Extensions

More terms from Jinyuan Wang, Feb 18 2019

A088054 Factorial primes: primes which are within 1 of a factorial number.

Original entry on oeis.org

2, 3, 5, 7, 23, 719, 5039, 39916801, 479001599, 87178291199, 10888869450418352160768000001, 265252859812191058636308479999999, 263130836933693530167218012159999999, 8683317618811886495518194401279999999
Offset: 1

Views

Author

Christopher M. Tomaszewski (cmt1288(AT)comcast.net), Nov 02 2003

Keywords

Comments

Conjecture: 3 is the intersection of A002981 and A002982.

Examples

			3! + 1 = 7; 7! - 1 = 5039.
39916801 is a term because 11! + 1 is prime.
		

Crossrefs

Union of A055490 and A088332.

Programs

  • Mathematica
    t = {}; Do[ If[PrimeQ[n! - 1], AppendTo[t, n! - 1]]; If[PrimeQ[n! + 1], AppendTo[t, n! + 1]], {n, 50}]; t (* Robert G. Wilson v *)
    Union[Select[Range[50]!-1, PrimeQ], Select[Range[50]!+1, PrimeQ]] (Noe)
    fp[n_] := Module[{nf=n!}, Select[{nf-1,nf+1},PrimeQ]]; Flatten[ Table[ fp[i],{i,50}]] (* Harvey P. Dale, Dec 18 2010 *)
    Select[Flatten[#+{-1,1}&/@(Range[50]!)],PrimeQ] (* Harvey P. Dale, Apr 08 2019 *)
  • Python
    from itertools import count, islice
    from sympy import isprime
    def A088054_gen(): # generator of terms
        f = 1
        for k in count(1):
            f *= k
            if isprime(f-1):
                yield f-1
            if isprime(f+1):
                yield f+1
    A088054_list = list(islice(A088054_gen(),10)) # Chai Wah Wu, Feb 18 2022

Extensions

Corrected by Paul Muljadi, Oct 11 2005
More terms from Robert G. Wilson v and T. D. Noe, Oct 12 2005

A089359 Primes which can be partitioned into distinct factorials. 0! and 1! are not considered distinct.

Original entry on oeis.org

2, 3, 7, 31, 127, 151, 727, 751, 5167, 5791, 5881, 40351, 40471, 41047, 41161, 45361, 45481, 362911, 363751, 368047, 368647, 368791, 403327, 403951, 408241, 408271, 408361, 409081, 3628927, 3629671, 3633991, 3634591, 3669241, 3669847, 3669961
Offset: 1

Views

Author

Amarnath Murthy, Nov 07 2003

Keywords

Examples

			From _Seiichi Manyama_, Mar 24 2018: (Start)
n | a(n) |
--+------+------------------
1 |    2 | 2!
2 |    3 | 2! + 1!
3 |    7 | 3! + 1!
4 |   31 | 4! + 3! + 1!
5 |  127 | 5! + 3! + 1!
6 |  151 | 5! + 4! + 3! + 1! (End)
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    def facbase(k, f):
        return sum(f[i] for i, bi in enumerate(bin(k)[2:][::-1]) if bi == "1")
    def auptoN(N): # terms up to N factorial-base digits; 20 generates b-file
        f = [factorial(i) for i in range(1, N+1)]
        return list(filter(isprime, (facbase(k, f) for k in range(2**N))))
    print(auptoN(10)) # Michael S. Branicky, Oct 15 2022

Extensions

More terms from Vladeta Jovovic, Nov 08 2003

A093804 Primes p such that p! + 1 is also prime.

Original entry on oeis.org

2, 3, 11, 37, 41, 73, 26951, 110059, 150209
Offset: 1

Views

Author

Jason Earls, May 19 2004

Keywords

Comments

Or, numbers n such that Sum_{d|n} d! is prime.
The prime 26951 from A002981 (n!+1 is prime) is a member since Sum_{d|n} d! = n!+1 if n is prime. - Jonathan Sondow, Jan 30 2005
a(n) are the primes in A002981[n] = {0, 1, 2, 3, 11, 27, 37, 41, 73, 77, 116, 154, 320, 340, 399, 427, 872, 1477, 6380, 26951, ...} Numbers n such that n! + 1 is prime. Corresponding primes of the form p! + 1 are listed in A103319[n] = {3, 7, 39916801, 13763753091226345046315979581580902400000001, 33452526613163807108170062053440751665152000000001, ...}. - Alexander Adamchuk, Sep 23 2006

Examples

			Sum_{d|3} d! = 1! + 3! = 7 is prime, so 3 is a member.
		

Crossrefs

Programs

Extensions

One more term from Alexander Adamchuk, Sep 23 2006
a(8)=110059 (found on Jun 11 2011, by PrimeGrid), added by Arkadiusz Wesolowski, Jun 28 2011
a(9)=150209 (found on Jun 09 2012, by Rene Dohmen), added by Jinyuan Wang, Jan 20 2020

A163075 Primes of the form k$ + 1. Here '$' denotes the swinging factorial function (A056040).

Original entry on oeis.org

2, 3, 7, 31, 71, 631, 3433, 51481, 2704157, 280816201, 4808643121, 35345263801, 2104098963721, 94684453367401, 1580132580471901, 483701705079089804581, 6892620648693261354601, 410795449442059149332177041, 2522283613639104833370312431401
Offset: 1

Views

Author

Peter Luschny, Jul 21 2009

Keywords

Examples

			Since 3$ = 4$ = 6 the prime 7 is listed, however only once.
		

Crossrefs

Cf. A056040, A088332, A163077 (arguments k), A163074, A163076.

Programs

  • Maple
    a := proc(n) select(isprime, map(x -> A056040(x)+1,[$1..n])) end:
  • Mathematica
    Reap[Do[f = n!/Quotient[n, 2]!^2; If[PrimeQ[p = f + 1], Sow[p]], {n, 1, 70}]][[2, 1]] // Union (* Jean-François Alcover, Jun 28 2013 *)

Extensions

More terms from Jinyuan Wang, Mar 22 2020
Showing 1-10 of 19 results. Next