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 17 results. Next

A098166 a(n) is the prime index of the Lesser Fortunate number A055211(n), or 0 if A055211(n) is not a prime.

Original entry on oeis.org

2, 4, 5, 6, 7, 10, 9, 14, 13, 21, 17, 15, 24, 19, 21, 28, 24, 26, 31, 25, 23, 24, 25, 54, 32, 30, 36, 56, 54, 48, 41, 77, 60, 36, 45, 40, 52, 51, 43, 48, 48, 62, 108, 62, 88, 49, 64, 74, 55, 63, 65, 111, 69, 66, 63, 123, 91, 66, 83, 92, 97, 110, 67, 75, 99, 87
Offset: 2

Views

Author

Pierre CAMI, Aug 30 2004

Keywords

Crossrefs

Programs

  • PARI
    a(n) = {my(k = prod(j=1, n, prime(j))); p = k-precprime(k-2); if(isprime(p), primepi(p), 0); } \\ Jinyuan Wang, Oct 02 2019

Formula

a(n) = A000720(A055211(n)) iff A055211(n) is a prime. - Michel Marcus, Oct 05 2019

Extensions

Name edited by and more terms from Jinyuan Wang, Oct 02 2019

A087201 a(n) is the smallest m such that m > A055211(n) and A002110(n)-m is prime.

Original entry on oeis.org

11, 13, 17, 19, 47, 37, 61, 67, 79, 107, 53, 149, 97, 89, 109, 223, 107, 179, 181, 101, 197, 101, 257, 139, 137, 197, 313, 257, 257, 223, 449, 373, 233, 463, 479, 409, 257, 409, 383, 317, 587, 607, 401, 463, 347, 313, 751, 313, 443, 349, 809, 661, 587, 367
Offset: 3

Views

Author

Farideh Firoozbakht, Aug 27 2003

Keywords

Comments

a(1) and a(2) are not defined. a(n) is the second m (first m is A055211(n)) such that m > 1 and A002110(n)-m is prime. I guess every term of this sequence (compare the conjecture about A055211) is prime. I checked this conjecture for n < 418.

Crossrefs

Programs

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

Formula

A055211[n_] := (For[m=2, !PrimeQ[Product[Prime[k], {k, n}]-m], m++ ]; m); a[n_] := (For[m=A055211[n]+1, !PrimeQ[Product[Prime[k], {k, n}]-m], m++ ]; m);

A097588 a(n)=floor(P(k)/P(n)) with P(k)=lesser Fortunate numbers for P(n)# (A055211).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2
Offset: 2

Views

Author

Pierre CAMI, Aug 29 2004

Keywords

Comments

Conjecture : a(n) is always < 8.

Examples

			a(11) = floor(73/31) = 2, A055211(11) = 73 prime(11) = 31,
2*3*5*7*11*13*17*19*23*29*31-73 is prime and 73 is the smallest odd number k such that p(11)# - k is prime.
		

Crossrefs

Cf. A055211.

A097590 a(n) = Sum_{i=2..n} A055211(i).

Original entry on oeis.org

3, 10, 21, 34, 51, 80, 103, 146, 187, 260, 319, 366, 455, 522, 595, 702, 791, 892, 1019, 1116, 1199, 1288, 1385, 1636, 1767, 1880, 2031, 2294, 2545, 2768, 2947, 3336, 3617, 3768, 3965, 4138, 4377, 4610, 4801, 5024, 5247, 5540, 6133, 6426, 6883, 7110, 7421
Offset: 2

Views

Author

Pierre CAMI, Aug 29 2004

Keywords

Crossrefs

Programs

  • Mathematica
    PrevPrime[ n_Integer] := Block[ {k = n - 1}, While[ ! PrimeQ[ k ], k-- ]; k ]; LF[ n_Integer ] := Block[ { p = Product[ Prime[ i ], {i, 1, n} ] - 1, q}, q = PrevPrime[ p ]; p - q + 1 ]; t = Table[LF[ n ], {n, 2, 48}]; Table[Plus @@ Take[t, n], {n, 47}] (* Robert G. Wilson v, Sep 04 2004 *)

Formula

Let F(n) := a(n)/A007504(n). Conjecture: as n tends to infinity F(n) tends to Pi/2 with Pi=3.14159......

Extensions

More terms from Robert G. Wilson v, Sep 04 2004

A005235 Fortunate numbers: least m > 1 such that m + prime(n)# is prime, where p# denotes the product of all primes <= p.

Original entry on oeis.org

3, 5, 7, 13, 23, 17, 19, 23, 37, 61, 67, 61, 71, 47, 107, 59, 61, 109, 89, 103, 79, 151, 197, 101, 103, 233, 223, 127, 223, 191, 163, 229, 643, 239, 157, 167, 439, 239, 199, 191, 199, 383, 233, 751, 313, 773, 607, 313, 383, 293, 443, 331, 283, 277, 271, 401, 307, 331
Offset: 1

Views

Author

Keywords

Comments

Reo F. Fortune conjectured that a(n) is always prime.
You might be searching for Fortunate Primes, which is an alternative name for this sequence. It is not the official name yet, because it is possible, although unlikely, that not all the terms are primes. - N. J. A. Sloane, Sep 30 2020
The first 500 terms are primes. - Robert G. Wilson v. The first 2000 terms are primes. - Joerg Arndt, Apr 15 2013
The strong form of Cramér's conjecture implies that a(n) is a prime for n > 1618, as previously noted by Golomb. - Charles R Greathouse IV, Jul 05 2011
a(n) is the smallest m such that m > 1 and A002110(n) + m is prime. For every n, a(n) must be greater than prime(n+1) - 1. - Farideh Firoozbakht, Aug 20 2003
If a(n) < prime(n+1)^2 then a(n) is prime. According to Cramér's conjecture a(n) = O(prime(n)^2). - Thomas Ordowski, Apr 09 2013
Conjectures from Pierre CAMI, Sep 08 2017: (Start)
If all terms are prime, then lim_{N->oo} (Sum_{n=1..N} primepi(a(n))) / (Sum_{n=1..N} n) = 3/2, and primepi(a(n))/n < 6 for all n.
Limit_{N->oo} (Sum_{n=1..N} a(n)) / (Sum_{n=1..N} prime(n)) = Pi/2.
a(n)/prime(n) < 8 for all n. (End)
Conjecture: Limit_{N->oo} (Sum_{n=1..N} a(n)) / (Sum_{n=1..N} prime(n)) = 3/2. - Alain Rocchelli, Dec 24 2022
The name "Fortunate numbers" was coined by Golomb (1981) after the New Zealand social anthropologist Reo Franklin Fortune (1903 - 1979). According to Golomb, Fortune's conjecture first appeared in print in Martin Gardner's Mathematical Games column in 1980. - Amiram Eldar, Aug 25 2020

Examples

			a(4) = 13 because P_4# = 2*3*5*7 = 210, plus one is 211, the next prime is 223 and the difference between 210 and 223 is 13.
		

References

  • Martin Gardner, The Last Recreations, Chapter 12: Strong Laws of Small Primes, Springer-Verlag, 1997, pp. 191-205, especially pp. 194-195.
  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd ed., Springer, 1994, Section A2, p. 11.
  • Stephen P. Richards, A Number For Your Thoughts, 1982, p. 200.
  • 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, pages 114-115.
  • David Wells, Prime Numbers: The Most Mysterious Figures In Math, Hoboken, New Jersey: John Wiley & Sons (2005), pp. 108-109.

Crossrefs

Programs

  • Haskell
    a005235 n = head [m | m <- [3, 5 ..], a010051'' (a002110 n + m) == 1]
    -- Reinhard Zumkeller, Apr 02 2014
    
  • Maple
    Primorial:= 2:
    p:= 2:
    A[1]:= 3:
    for n from 2 to 100 do
      p:= nextprime(p);
      Primorial:= Primorial * p;
      A[n]:= nextprime(Primorial+p+1)-Primorial;
    od:
    seq(A[n],n=1..100); # Robert Israel, Dec 02 2015
  • Mathematica
    NPrime[n_Integer] := Module[{k}, k = n + 1; While[! PrimeQ[k], k++]; k]; Fortunate[n_Integer] := Module[{p, q}, p = Product[Prime[i], {i, 1, n}] + 1; q = NPrime[p]; q - p + 1]; Table[Fortunate[n], {n, 60}]
    r[n_] := (For[m = (Prime[n + 1] + 1)/2, ! PrimeQ[Product[Prime[k], {k, n}] + 2 m - 1], m++]; 2 m - 1); Table[r[n], {n, 60}]
    FN[n_] := Times @@ Prime[Range[n]]; Table[NextPrime[FN[k] + 1] - FN[k], {k, 60}] (* Jayanta Basu, Apr 24 2013 *)
    NextPrime[#]-#+1&/@(Rest[FoldList[Times,1,Prime[Range[60]]]]+1) (* Harvey P. Dale, Dec 15 2013 *)
  • PARI
    a(n)=my(P=prod(k=1,n,prime(k)));nextprime(P+2)-P \\ Charles R Greathouse IV, Jul 15 2011; corrected by Jean-Marc Rebert, Jul 28 2015
    
  • Python
    from sympy import nextprime, primorial
    def a(n): psharp = primorial(n); return nextprime(psharp+1) - psharp
    print([a(n) for n in range(1, 59)]) # Michael S. Branicky, Jan 15 2022
  • Sage
    def P(n): return prod(nth_prime(k) for k in range(1, n + 1))
    it = (P(n) for n in range(1, 31))
    print([next_prime(Pn + 2) - Pn for Pn in it]) # F. Chapoton, Apr 28 2020
    

Formula

If x(n) = 1 + Product_{i=1..n} prime(i), q(n) = least prime > x(n), then a(n) = q(n) - x(n) + 1.
a(n) = 1 + the difference between the n-th primorial plus one and the next prime.
a(n) = A035345(n) - A002110(n). - Jonathan Sondow, Dec 02 2015

A179975 Smallest k such that k*10^n is a sum of two successive primes.

Original entry on oeis.org

5, 3, 1, 6, 6, 6, 14, 6, 9, 19, 21, 21, 42, 93, 21, 6, 11, 2, 12, 111, 37, 39, 63, 38, 42, 24, 15, 15, 60, 6, 39, 82, 47, 58, 337, 49, 72, 25, 34, 21, 6, 107, 128, 96, 20, 2, 63, 231, 70, 7, 62, 144, 28, 151, 157, 33, 98, 55, 134, 162, 87, 201, 124, 303, 64, 106, 130, 13, 43
Offset: 0

Views

Author

Zak Seidov, Aug 04 2010

Keywords

Comments

From Robert G. Wilson v, Aug 11 2010: (Start)
A179975 n's such that a(n)=1: 3, 335, ..., .
A179975 First occurrence of k: 3, 18, 2, ???, 1, 4, 50, 162, 9, 335, 17, 19, 68, 7, 27, ..., .
Records: 5, 6, 14, 19, 21, 42, 93, 111, 337, 449, 862, 1049, 1062, 1122, 1280, 2278, 3168, 4290, ..., . (End)

Examples

			a(0)=5 because 5=2+3
a(1)=3 because 30=13+17
a(2)=1 because 100=47+53
a(3)=6 because 6000=2999+3001.
		

Crossrefs

Programs

  • Mathematica
    Join[{5,3},Reap[Do[Do[n=10^m k; If[n==PreviousPrime[n/2]+NextPrime[n/2],Sow[k];Break[]],{k,2000}],{m,2,50}]][[2,1]]]
    f[n_] := Block[{k = 1, tn = 10^n}, While[h = k*tn/2; NextPrime[h, -1] + NextPrime@h != k*tn, k++ ]; k]; f[1] = 3; Array[f, 70, 0] (* Robert G. Wilson v, Aug 11 2010 *)

Extensions

More terms from Robert G. Wilson v, Aug 11 2010

A060270 Distance of n-th primorial from previous prime.

Original entry on oeis.org

1, 1, 11, 1, 1, 29, 23, 43, 41, 73, 59, 1, 89, 67, 73, 107, 89, 101, 127, 97, 83, 89, 1, 251, 131, 113, 151, 263, 251, 223, 179, 389, 281, 151, 197, 173, 239, 233, 191, 223, 223, 293, 593, 293, 457, 227, 311, 373, 257, 307, 313, 607, 347, 317, 307, 677, 467, 317
Offset: 2

Views

Author

Labos Elemer, Mar 23 2001

Keywords

Examples

			Before 7th primorial 510481 is the largest prime. Its distance from 510510 is a(7)=29.
		

Crossrefs

Programs

  • Maple
    [seq(product(ithprime(j),j=1..n)-prevprime(product(ithprime(j),j=1..n)), n=2..50)];
  • Mathematica
    Map[# - NextPrime[#, -1] &, Rest@ FoldList[Times, Prime@ Range[59]]] (* Michael De Vlieger, Aug 10 2023 *)
  • PARI
    a(n) = my(P=vecprod(primes(n))); P-precprime(P-1); \\ Michel Marcus, Aug 11 2023

Formula

a(n)=1 for n=2, 3, 5, 6, 13, 24, 66, 68, 167, ... (A057704); a(n)=A055211(n) otherwise. - Jeppe Stig Nielsen, Oct 31 2003

Extensions

More terms from Jeppe Stig Nielsen, Oct 31 2003

A037155 a(n) = n!-p, where p is the largest prime < (n!-1).

Original entry on oeis.org

3, 5, 7, 11, 17, 31, 13, 11, 13, 13, 23, 17, 47, 53, 59, 41, 101, 31, 31, 73, 89, 73, 149, 37, 43, 101, 31, 79, 61, 163, 47, 193, 113, 127, 97, 79, 73, 83, 131, 79, 109, 109, 53, 89, 79, 103, 59, 97, 179, 67, 59, 127, 61, 461, 277, 109, 137, 139, 71, 71, 101, 359
Offset: 3

Views

Author

Keywords

Comments

Analogous to the lesser Fortunate numbers and like them, all entries so far are primes.

Examples

			a(4) = 4!-19 = 24-19 = 5.
		

Crossrefs

Cf. A055211.

Programs

  • Mathematica
    PrevPrime[ n_Integer ] := (k=n-1; While[ !PrimeQ[ k ], k-- ]; Return[ k ]); f[ n_Integer ] := (p = n! - 1; q = NextPrime[ p ]; Return[ p - q + 1 ]); Table[ f[ n ], {n, 3, 75} ]
    f[n_]:=Module[{nf=n!},nf-NextPrime[nf-1,-1]];f/@Range[3,90]  (* Harvey P. Dale, Mar 20 2011 *)
  • PARI
    a(n)=my(N=n!); N-precprime(N-3) \\ Charles R Greathouse IV, Jan 28 2018
    
  • Python
    from sympy import factorial, prevprime
    def a(n): fn = factorial(n); return fn - prevprime(fn-1)
    print([a(n) for n in range(3, 65)]) # Michael S. Branicky, May 22 2022

Formula

a(n) >= n. - Seiichi Manyama, Mar 21 2018

Extensions

More terms from James Sellers, Jul 06 2000

A098167 Partial sums of A098166.

Original entry on oeis.org

2, 6, 11, 17, 24, 34, 43, 57, 70, 91, 108, 123, 147, 166, 187, 215, 239, 265, 296, 321, 344, 368, 393, 447, 479, 509, 545, 601, 655, 703, 744, 821, 881, 917, 962, 1002, 1054, 1105, 1148, 1196, 1244, 1306, 1414, 1476, 1564, 1613, 1677, 1751, 1806, 1869, 1934, 2045
Offset: 2

Views

Author

Pierre CAMI, Aug 30 2004

Keywords

Crossrefs

Extensions

More terms from Jinyuan Wang, Mar 05 2020

A268607 a(n) is the least m > 1 such that 2^n - m is prime.

Original entry on oeis.org

2, 3, 3, 3, 3, 15, 5, 3, 3, 9, 3, 13, 3, 19, 15, 9, 5, 19, 3, 9, 3, 15, 3, 39, 5, 39, 57, 3, 35, 19, 5, 9, 41, 31, 5, 25, 45, 7, 87, 21, 11, 57, 17, 55, 21, 115, 59, 81, 27, 129, 47, 111, 33, 55, 5, 13, 27, 55, 93, 31, 57, 25, 59, 49, 5, 19, 23, 19, 35, 231, 93
Offset: 2

Views

Author

Alexei Kourbatov, Feb 08 2016

Keywords

Comments

a(1) is not defined (there are no primes less than 2).
The definition is similar to Lesser Fortunate numbers (A055211) but uses 2^n instead of primorials A002110(n).

Examples

			a(7)=15 because m=15 is the least m > 1 such that 2^7 - m is prime.
		

Crossrefs

Programs

  • Mathematica
    Map[# - NextPrime[#-1, -1] &, 2^Range[2, 100]] (* Paolo Xausa, Mar 10 2025 *)
  • PARI
    a(n)=2^n-precprime(2^n-2)

Formula

a(n) = A013603(n), if A013603(n) > 1. - Jason Yuen, Mar 10 2025
Showing 1-10 of 17 results. Next