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

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

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Analogous to Fortunate numbers and like them, the entries appear to be primes. In fact, the first 1200 terms are primes. Are all terms prime?
a(n) is the first (smallest) m such that m > 1 and n!+ m is prime. The second such m is A087202(n). a(n) must be greater than nextprime(n)-1. - Farideh Firoozbakht, Sep 01 2003
Sequence A069941, which counts the primes between n! and n!+n^2, provides numerical evidence that the smallest prime p greater than n!+1 is a prime distance from n!; that is, p-n! is a prime number. For p-n! to be a composite number, p would have to be greater than n!+n^2, which would imply that A069941(n)=0. - T. D. Noe, Mar 06 2010
The first 4003 terms are prime. - Dana Jacobsen, May 10 2015

Crossrefs

Programs

  • Magma
    z:=125; [p-f where p is NextPrime(f+1) where f is Factorial(n): n in [1..z]]; // Klaus Brockhaus, Mar 02 2010
    
  • Mathematica
    NextPrime[ n_Integer ] := (k=n+1; While[ !PrimeQ[ k ], k++ ]; Return[ k ]); f[ n_Integer ] := (p = n! + 1; q = NextPrime[ p ]; Return[ q - p + 1 ]); Table[ f[ n ], {n, 1, 75} ] (* Robert G. Wilson v *)
  • MuPAD
    for n from 1 to 65 do f := n!:a := nextprime(f+2)-f:print(a) end_for; // Zerinvary Lajos, Feb 22 2007
    
  • PARI
    a(n)=nextprime(n!+2)-n! \\ Charles R Greathouse IV, Jul 02 2013; Corrected by Dana Jacobsen, May 10 2015
    
  • Perl
    use ntheory ":all"; for my $n (1..1000) { my $f=factorial($n); say "$n ",next_prime($f+1)-$f; } # Dana Jacobsen, May 10 2015
    
  • Python
    from sympy import factorial, nextprime
    def a(n): fn = factorial(n); return nextprime(fn+1) - fn
    print([a(n) for n in range(1, 66)]) # Michael S. Branicky, May 22 2022

Extensions

Edited by N. J. A. Sloane, Mar 06 2010

A160433 a(n) is the least number k such that (k-th prime after n!+1)-n! is not a prime.

Original entry on oeis.org

2, 2, 3, 7, 8, 15, 8, 18, 16, 19, 12, 20, 11, 8, 11, 6, 12, 23, 24, 15, 31, 21, 27, 15, 16, 26, 25, 17, 17, 29, 20, 27, 27, 30, 23, 16, 28, 23, 25, 29, 15, 24, 19, 36, 36, 39, 15, 36, 24, 44, 35, 29, 27, 25, 36, 22, 37, 31, 32, 41, 29, 55, 27, 45, 29, 59, 34, 37, 24, 49, 25, 40
Offset: 0

Views

Author

Frederick Magata (frederick.magata(AT)web.de), May 13 2009

Keywords

Comments

The conjectures from A037153 and A087202 can be rephrased using a(n):
Is a(n)>=2 for all n>=0 and a(n)>=3 for all n>=2?
Also compare this with the conjecture on the fortunate numbers A005235.
Is the following true: for every m there is an N such that for all n>N a(n)>m?
There even seems to be the estimate a(n)>log(n+1)*sqrt(n+1)/2.

Examples

			a(3)=7: The seven primes following 3!+1=7 are 11,13,17,19,23,29 and 31.
Subtracting 3!=6 from each of them gives 5,7,11,13,17,23 and 25.
The first six values are prime, while the seventh 25=5^2 is not.
		

Crossrefs

Programs

  • Maple
    a:=proc(n) option remember; local k:
    for k from 1 while isprime((nextprime@@k)(n!+1)-n!) do od:
    k; end;

A087203 a(n) is the smallest m such that m > A037155(n) and n!- m is prime.

Original entry on oeis.org

4, 7, 11, 19, 19, 37, 17, 17, 17, 17, 61, 43, 59, 71, 61, 43, 113, 71, 41, 101, 191, 103, 191, 179, 71, 127, 37, 97, 113, 373, 71, 373, 293, 157, 149, 241, 167, 211, 151, 89, 131, 113, 73, 107, 179, 227, 173, 113, 257, 239, 151, 227, 163, 509, 293, 347, 643, 373, 457
Offset: 3

Views

Author

Farideh Firoozbakht, Sep 01 2003

Keywords

Comments

a(1) and a(2) are not defined. a(n) is the second m (first m is A037155(n)) such that m > 1 and n!- m is prime.For 3 < n < 643,a(n) is prime. I guess (compare the conjecture about A087202) except for the first term, every term of this sequence is prime.

Crossrefs

Programs

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

Formula

A037155[3]=3; A037155[n_] := (For[m=Prime[PrimePi[n]+1], !PrimeQ[n!-m], m++ ]; m); a[n_] := (For[m=A037155[n]+1, !PrimeQ[n!-m], m++ ]; m)
Showing 1-3 of 3 results.