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

A087202 a(n) is the smallest m such that m > A037153(n) and n!+ m is prime.

Original entry on oeis.org

4, 5, 7, 7, 11, 13, 19, 31, 23, 19, 19, 43, 73, 41, 149, 41, 53, 61, 109, 37, 37, 71, 109, 193, 97, 173, 59, 101, 229, 163, 241, 83, 139, 103, 83, 577, 397, 47, 269, 61, 211, 107, 97, 89, 379, 149, 269, 83, 137, 167, 281, 89, 79, 443, 229, 157, 179, 563, 389, 277
Offset: 1

Views

Author

Farideh Firoozbakht, Sep 01 2003

Keywords

Comments

a(n) is the second m (first m is A037153(n)) such that m > 1 and n!+ m is prime.
Conjecture: For n > 1, a(n) is prime (compare the conjecture about A037153).
Conjecture holds through 1200 terms.

Crossrefs

Programs

  • Mathematica
    A037153[n_] := (For[m=Prime[PrimePi[n]+1], !PrimeQ[n!+m], m++ ]; m); a[n_] := (For[m=A037153[n]+1, !PrimeQ[n!+m], m++ ]; m); Table[a[n], {n, 60}]

Extensions

Edited by Ray Chandler, Mar 08 2010

A033932 Least positive m such that n! + m is prime.

Original entry on oeis.org

1, 1, 1, 1, 5, 7, 7, 11, 23, 17, 11, 1, 29, 67, 19, 43, 23, 31, 37, 89, 29, 31, 31, 97, 131, 41, 59, 1, 67, 223, 107, 127, 79, 37, 97, 61, 131, 1, 43, 97, 53, 1, 97, 71, 47, 239, 101, 233, 53, 83, 61, 271, 53, 71, 223, 71, 149, 107, 283, 293, 271, 769, 131, 271
Offset: 0

Views

Author

Keywords

Comments

Conjecture: No term is a composite number. a(n) is a prime > 3*prime(k), where k is such that prime(k) < n <= prime(k+1). - Amarnath Murthy, Apr 07 2004
Terms after n = 2000 in the b-file correspond to Fermat and Lucas PRP. - Phillip Poplin, Oct 12 2019

Crossrefs

Programs

  • Maple
    a:= n-> (f-> nextprime(f)-f)(n!):
    seq(a(n), n=0..70);  # Alois P. Heinz, Feb 22 2023
  • Mathematica
    a[n_] := (an = 1; While[ !PrimeQ[n! + an], an++]; an); Table[a[n], {n, 0, 63}] (* Jean-François Alcover, Dec 05 2012 *)
    NextPrime[#]-#&/@(Range[0,70]!) (* Harvey P. Dale, May 18 2014 *)
  • PARI
    for(n=0,70, k=1; while(!isprime(n!+k), k++); print1(k,","))
    
  • PARI
    a(n) = nextprime(n!+1) - n!; \\ Michel Marcus, Dec 25 2020
    
  • Python
    from sympy import factorial, nextprime
    def a(n): fn = factorial(n); return nextprime(fn) - fn
    print([a(n) for n in range(64)]) # Michael S. Branicky, May 22 2022

Formula

a(n) = A151800(n!) - n!. - Max Alekseyev, Jul 23 2014

Extensions

More terms from Jud McCranie
a(21) onwards from Wouter Meeussen
Better description from Rick L. Shepherd, Nov 06 2002

A067362 a(n) = p - n!^2, where p is the smallest prime > n!^2+1.

Original entry on oeis.org

2, 3, 5, 11, 7, 11, 11, 13, 23, 17, 13, 59, 23, 31, 23, 41, 59, 67, 29, 31, 103, 389, 59, 107, 47, 127, 67, 181, 101, 97, 409, 37, 61, 43, 61, 47, 263, 109, 53, 199, 167, 337, 47, 131, 127, 73, 181, 257, 191, 101, 83, 79, 181, 167, 229, 859, 421, 433, 107, 971
Offset: 1

Views

Author

Frank Buss (fb(AT)frank-buss.de), Jan 19 2002

Keywords

Comments

The first 157 terms are primes. Are all terms prime? For n!^i, with 0
The first 200 terms are primes. - Jon Perry and Christ van Willegen, Mar 07 2003
The first 3003 terms are primes. - Dana Jacobsen, May 13 2015

Programs

  • Mathematica
    a[n_] := For[i=2, True, i++, If[PrimeQ[n!^2+i], Return[i]]]
    Table[p = NextPrime[(x = (n!)^2) + 1]; p - x, {n, 60}] (* Jayanta Basu, Aug 10 2013 *)
  • MuPAD
    for n from 1 to 50 do f := n!^2:a := nextprime(f+2)-f:print(a) end_for
    
  • PARI
    for(n=1,500,f=n!^2;print1(nextprime(f+2)-f, ", ")) \\  Dana Jacobsen, May 10 2015
    
  • Perl
    use ntheory ":all"; use Math::GMP qw/:constant/; for my $n (1..500) { my $f=factorial($n)**2; say "$n ",next_prime($f+1)-$f; } # Dana Jacobsen, May 10 2015

Extensions

Edited by Dean Hickerson, Mar 02 2002

A090786 Least nonnegative integer k such that n! + n + k + 1 is prime.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 3, 14, 7, 0, 5, 16, 53, 4, 27, 6, 13, 18, 69, 8, 9, 8, 73, 106, 15, 32, 19, 38, 193, 76, 95, 46, 3, 62, 25, 94, 273, 4, 57, 12, 19, 54, 27, 2, 193, 54, 185, 4, 33, 10, 219, 0, 17, 168, 15, 92, 49, 224, 233, 210, 707, 68, 207, 2, 127, 216, 5, 14, 61, 68, 785
Offset: 0

Author

Frederick Magata (frederick.magata(AT)uni-muenster.de), Feb 09 2004

Keywords

Comments

The (n-1) consecutive numbers n!+2, ..., n!+n (for n >= 2) are not prime. This fact implies that there are arbitrarily large gaps in the distribution of the prime numbers. However, n!+n+1 need not be a prime number. Now a(n) measures, when the next prime number after n!+n appears. Thus a(n)=0 means that n!+n+1 is prime and so on. Obviously, a(n) is parity conserving for n >= 2. I.e., if n >= 2 then 2 divides n iff 2 divides a(n).
Conjectures: By definition a(n)+n!+1 is prime, but is a(n)+n+1=A037153(n) also a prime number for all n > 2? Is the growth of b(n) := Sum_{k=0..n} a(k) quadratic, that is, is b(n)=O(n^2)?

Examples

			a(5)=1 because 5!+5+1+1=127 is prime and 126 is not.
a(7)=3 because 7!+7+3+1=5051 is prime and 5048, 5049 and 5050 are not prime.
		

Crossrefs

Programs

  • Maple
    a := proc(n) option remember;local r,m,k: r := n!+n: k := 1: m := r+1: while (not isprime(m)) do k := k+1: while (not igcd(k,n)=1) do k := k+1: od: m := r+k: od: k-1; end;
    # alternatively:
    a := proc(n) option remember; nextprime(n!+n)-n!-n-1; end;
  • Mathematica
    lnik[n_]:=Module[{c=n!+n+1},If[PrimeQ[c],0,NextPrime[c]-c]]; Array[ lnik, 80,0] (* Harvey P. Dale, Apr 08 2019 *)
  • PARI
    a(n) = apply(x->(nextprime(x)-x), n!+n+1); \\ Michel Marcus, Mar 21 2018

A275272 a(n) = p - n!, where p is the second smallest prime > n!.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 19, 31, 23, 19, 17, 43, 73, 41, 149, 41, 53, 61, 109, 37, 37, 71, 109, 193, 97, 173, 47, 101, 229, 163, 241, 83, 139, 103, 83, 577, 311, 47, 269, 61, 61, 107, 97, 89, 379, 149, 269, 83, 137, 167, 281, 89, 79, 443, 229, 157, 179, 563, 389
Offset: 1

Author

Clark Kimberling, Jul 23 2016

Keywords

Comments

p-n! where p = nextprime(nextprime(n!)).
Is every term a prime?

Examples

			For n = 4, we have n! = 24, so that p = 31 and a(4) = 7.
		

Crossrefs

Programs

  • Mathematica
    Table[NextPrime[n!, 2] - n!, {n, 1, 150}]
  • PARI
    a(n) = nextprime(nextprime(n!+1)+1) - n!; \\ Michel Marcus, Mar 05 2022
    
  • Python
    from sympy import factorial, nextprime
    def a(n): fn = factorial(n); return nextprime(nextprime(fn)) - fn
    print([a(n) for n in range(1, 60)]) # Michael S. Branicky, Mar 05 2022

Formula

a(n) = A187874(n) - A000142(n). - Michel Marcus, Mar 05 2022

A067363 a(n)=p-n!^3, where p is the smallest prime > n!^3+1.

Original entry on oeis.org

2, 3, 7, 5, 17, 11, 17, 23, 23, 103, 59, 17, 29, 79, 59, 23, 347, 307, 53, 227, 131, 83, 67, 223, 29, 59, 197, 83, 181, 293, 71, 71, 139, 43, 67, 103, 431, 743, 1279, 197, 419, 127, 271, 73, 229, 503, 211, 181, 1597, 151, 151, 197, 1013, 179, 587, 71, 137, 547
Offset: 1

Author

Frank Buss (fb(AT)frank-buss.de), Jan 19 2002

Keywords

Comments

The first 118 terms are primes. Are all terms prime? For n!^i, with 0
The first 2278 terms are primes. - Dana Jacobsen, May 13 2015

Programs

  • Mathematica
    a[n_] := For[i=2, True, i++, If[PrimeQ[n!^3+i], Return[i]]]
    spn[n_]:=Module[{c=(n!)^3},NextPrime[c+1]-c]; Array[spn,60] (* Harvey P. Dale, May 25 2023 *)
  • MuPAD
    for n from 1 to 50 do f := n!^3:a := nextprime(f+2)-f:print(a) end_for
    
  • PARI
    for(n=1, 100, f=n!^3; print1(nextprime(f+2)-f,", ")) \\ Dana Jacobsen, May 13 2015
    
  • Perl
    use ntheory ":all"; use Math::GMP qw/:constant/; for my $n (1..500) { my $f=factorial($n)**3; say "$n ", next_prime($f+1)-$f; } # Dana Jacobsen, May 13 2015

Extensions

Edited by Dean Hickerson, Mar 02 2002

A067364 a(n)=p-n!^4, where p is the smallest prime > n!^4+1.

Original entry on oeis.org

2, 3, 5, 5, 7, 29, 19, 29, 181, 19, 31, 173, 79, 43, 379, 61, 101, 127, 101, 83, 37, 29, 271, 233, 109, 233, 293, 1039, 137, 241, 173, 197, 613, 1933, 277, 71, 503, 449, 1667, 53, 67, 163, 179, 211, 53, 613, 1171, 1069, 359, 199, 839, 433, 1523, 463, 677
Offset: 1

Author

Frank Buss (fb(AT)frank-buss.de), Jan 19 2002

Keywords

Comments

The first 102 terms are primes. Are all terms prime? For n!^i, with 0
The first 1865 terms are primes. - Dana Jacobsen, May 13 2015

Programs

  • Mathematica
    a[n_] := For[i=2, True, i++, If[PrimeQ[n!^4+i], Return[i]]]
  • MuPAD
    for n from 1 to 50 do f := n!^4:a := nextprime(f+2)-f:print(a) end_for
    
  • PARI
    for(n=1, 500, f=n!^4; print1(nextprime(f+2)-f, ", ")) \\ Dana Jacobsen, May 13 2015
    
  • Perl
    use ntheory ":all"; use Math::GMP qw/:constant/; for my $n (1..500) { my $f=factorial($n)**4; say "$n ", next_prime($f+1)-$f; } # Dana Jacobsen, May 13 2015

Extensions

Edited by Dean Hickerson, Mar 02 2002

A067365 a(n) = p-n!^5, where p is the smallest prime > n!^5+1.

Original entry on oeis.org

2, 5, 13, 13, 7, 7, 11, 71, 23, 19, 197, 17, 101, 53, 17, 47, 73, 97, 53, 433, 251, 251, 47, 263, 281, 353, 53, 61, 179, 41, 53, 401, 449, 79, 89, 1283, 367, 2011, 139, 227, 1597, 1657, 1123, 397, 131, 727, 137, 167, 89, 379, 421, 653, 223, 373, 2221, 1447
Offset: 1

Author

Frank Buss (fb(AT)frank-buss.de), Jan 19 2002

Keywords

Comments

The first 60 terms are primes. Are all terms prime? For n!^i, with 0
The first 1592 terms are primes. - Dana Jacobsen, May 13 2015

Programs

  • Mathematica
    a[n_] := For[i=2, True, i++, If[PrimeQ[n!^5+i], Return[i]]]
    spf[n_]:=Module[{c=(n!)^5},NextPrime[c+1]-c]; Array[spf,60] (* Harvey P. Dale, Feb 24 2015 *)
  • MuPAD
    for n from 1 to 50 do f := n!^5:a := nextprime(f+2)-f:print(a) end_for
    
  • PARI
    for(n=1, 100, f=n!^5; print1(nextprime(f+2)-f, ", ")) \\ Dana Jacobsen, May 13 2015
    
  • Perl
    use ntheory ":all"; use Math::GMP qw/:constant/; for my $n (1..500) { my $f=factorial($n)**5; say "$n ", next_prime($f+1)-$f; } # Dana Jacobsen, May 13 2015

Extensions

Edited by Dean Hickerson, Mar 02 2002

A037152 Smallest prime > n!+1.

Original entry on oeis.org

3, 5, 11, 29, 127, 727, 5051, 40343, 362897, 3628811, 39916817, 479001629, 6227020867, 87178291219, 1307674368043, 20922789888023, 355687428096031, 6402373705728037, 121645100408832089, 2432902008176640029
Offset: 1

Author

Keywords

Comments

Main entry for this sequence is A037153.

Crossrefs

Programs

  • Mathematica
    NextPrime[Range[20]!+1] (* Harvey P. Dale, Apr 08 2012 *)
  • Maxima
    makelist(next_prime(n!+1), n,  1, 20); /* Bruno Berselli, May 20 2011 */
    
  • PARI
    for(n=1,100,print1(nextprime(n!+2),", ")); /* Joerg Arndt, May 21 2011 */

Formula

a(n) = A151800(A000142(n)+1) = A000142(n) + A037153(n).
a(n) = A151800(A038507(n)). - Michel Marcus, Feb 18 2024

Extensions

Extended by Ray Chandler, Mar 07 2010

A069941 Number of primes p such that n! <= p <= n! + n^2.

Original entry on oeis.org

1, 3, 3, 3, 4, 5, 5, 4, 7, 7, 9, 6, 5, 8, 4, 9, 10, 14, 8, 16, 14, 14, 7, 6, 16, 12, 12, 15, 13, 12, 9, 12, 12, 17, 13, 6, 12, 18, 15, 13, 15, 17, 15, 23, 19, 12, 13, 19, 18, 22, 20, 19, 16, 17, 19, 19, 23, 20, 18, 19, 23, 24, 19, 15, 19, 20, 26, 18, 24, 22, 24, 25, 24, 16, 23
Offset: 1

Author

Benoit Cloitre, May 04 2002

Keywords

Comments

Conjecture: if n>=2 there are at least 3 primes p such that n!<=p<=n!+n^2 (or stronger: for n>1, a(n) > log(n)). This is stronger than the conjecture described in A037151(n). Because if n!+k is prime, k composite, k=A*B, where A and B must have, each one, at least one prime factor>n (if not: A=q*A' q<=n then n!+k is divisible by q), hence k>n^2. Also stronger (but more restrictive) than the Schinzel conjecture: "for m large enough there's at least one prime p such that m <= p <= m + log(m)^2" since n^2 < log(n!)^2 for n>5.
For the n-th term we have a(n) = pi(n!+n^2) - pi(n!), where pi(x) is the prime counting function. However, pi(n!) is difficult to compute for n>25. The Prime Number Theorem states that pi(x) and Li(x), the logarithmic integral, are asymptotically equal. Hence we can approximate a(n) by Li(n!+n^2) - Li(n!). These approximate values of a(n) are plotted as the red curve in the "Theoretical versus Actual" plot. By the way, using x/log(x) as approximation for Li(x) would change the curve by at most 1 unit. - T. D. Noe, Mar 06 2010

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Range[n!,n!+n^2], PrimeQ]], {n,100}] (* T. D. Noe, Mar 06 2010 *)
  • PARI
    for(n=1,75,print1(sum(k=n!,n!+n^2,isprime(k)),","))
Showing 1-10 of 19 results. Next