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

A226557 a(n) = |A020497(n) - prime(n+4) + 10|.

Original entry on oeis.org

0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 2, 4, 2, 2, 0, 2, 4, 12, 12, 4, 6, 4, 8, 2, 6, 6, 4, 2, 0, 0, 6, 2, 4, 2, 8, 0, 2, 4, 2, 4, 8, 10, 6, 6
Offset: 1

Views

Author

Vladimir Shevelev, Jun 10 2013

Keywords

Comments

Approximation of A020497(n) by function of the form prime(n+k) - c, where k,c are constants. The choice k=4 is stipulated by removing 2 and 5 from the considered prime constellations and 11 is chosen as the first prime (for n=1), since the second constellation {11,13} should be a twin pair. The choice c=10 corresponds to a(0) = 0.
a(n) = 0 for n=1,2,3,4,5,7,8,9,10,11,12,13,14,15,16,22,36,37,43,...

Crossrefs

Cf. A020497.

A007918 Least prime >= n (version 1 of the "next prime" function).

Original entry on oeis.org

2, 2, 2, 3, 5, 5, 7, 7, 11, 11, 11, 11, 13, 13, 17, 17, 17, 17, 19, 19, 23, 23, 23, 23, 29, 29, 29, 29, 29, 29, 31, 31, 37, 37, 37, 37, 37, 37, 41, 41, 41, 41, 43, 43, 47, 47, 47, 47, 53, 53, 53, 53, 53, 53, 59, 59, 59, 59, 59, 59, 61, 61, 67, 67, 67, 67, 67, 67, 71, 71, 71, 71, 73, 73
Offset: 0

Views

Author

R. Muller and Charles T. Le (charlestle(AT)yahoo.com)

Keywords

Comments

Version 2 of the "next prime" function is "smallest prime > n". This produces A151800.
Maple uses version 2.
According to the "k-tuple" conjecture, a(n) is the initial term of the lexicographically earliest increasing arithmetic progression of n primes; the corresponding common differences are given by A061558. - David W. Wilson, Sep 22 2007
It is easy to show that the initial term of an increasing arithmetic progression of n primes cannot be smaller than a(n). - N. J. A. Sloane, Oct 18 2007
Also, smallest prime bounded by n and 2n inclusively (in accordance with Bertrand's theorem). Smallest prime >n is a(n+1) and is equivalent to smallest prime between n and 2n exclusively. - Lekraj Beedassy, Jan 01 2007
Run lengths of successive equal terms are given by A125266. - Felix Fröhlich, May 29 2022
Conjecture: if n > 1, then a(n) < n^(n^(1/n)). - Thomas Ordowski, Feb 23 2023

Crossrefs

Programs

  • Haskell
    a007918 n = a007918_list !! n
    a007918_list = 2 : 2 : 2 : concat (zipWith
                  (\p q -> (replicate (fromInteger(q - p)) q))
                                       a000040_list $ tail a000040_list)
    -- Reinhard Zumkeller, Jul 26 2012
    
  • Magma
    [2] cat [NextPrime(n-1): n in [1..80]]; // Vincenzo Librandi, Jan 14 2016
    
  • Maple
    A007918 := n-> nextprime(n-1); # M. F. Hasler, Apr 09 2008
  • Mathematica
    NextPrime[Range[-1, 72]] (* Jean-François Alcover, Apr 18 2011 *)
  • PARI
    A007918(n)=nextprime(n)  \\ M. F. Hasler, Jun 24 2011
    
  • PARI
    for(x=0,100,print1(nextprime(x)",")) \\ Cino Hilliard, Jan 15 2007
    
  • Python
    from sympy import nextprime
    def A007918(n): return nextprime(n-1) # Chai Wah Wu, Apr 22 2022

Formula

For n > 1: a(n) = A000040(A049084(A007917(n)) + 1 - A010051(n)). - Reinhard Zumkeller, Jul 26 2012
a(n) = A151800(n-1). - Seiichi Manyama, Apr 02 2018

A008407 Minimal difference s(n) between beginning and end of n consecutive large primes (n-tuplet) permitted by divisibility considerations.

Original entry on oeis.org

0, 2, 6, 8, 12, 16, 20, 26, 30, 32, 36, 42, 48, 50, 56, 60, 66, 70, 76, 80, 84, 90, 94, 100, 110, 114, 120, 126, 130, 136, 140, 146, 152, 156, 158, 162, 168, 176, 182, 186, 188, 196, 200, 210, 212, 216, 226, 236, 240, 246, 252, 254, 264, 270, 272, 278
Offset: 1

Views

Author

T. Forbes (anthony.d.forbes(AT)googlemail.com)

Keywords

Comments

Tony Forbes defines a prime k-tuplet (distinguished from a prime k-tuple) to be a maximally possible dense cluster of primes (a prime constellation) which will necessarily involve consecutive primes whereas a prime k-tuple is a prime cluster which may not necessarily be of maximum possible density (in which case the primes are not necessarily consecutive.)
a(n) >> n log log n; in particular, for any eps > 0, there is an N such that a(n) > (e^gamma - eps) n log log n for all n > N. Probably N can be chosen as 1; the actual rate of growth is larger. Can a larger growth rate be established? Perhaps a(n) ~ n log n. - Charles R Greathouse IV, Apr 19 2012
Conjecture: (i) The sequence a(n)^(1/n) (n=3,4,...) is strictly decreasing (to the limit 1). (ii) We have 0 < a(n)/n - H_n < (gamma + 2)/(log n) for all n > 4, where H_n denotes the harmonic number 1+1/2+1/3+...+1/n, and gamma refers to the Euler constant 0.5772... [The second inequality has been verified for n = 5, 6, ..., 5000.] - Zhi-Wei Sun, Jun 28 2013.
Conjecture: For any integer n > 2, there is 1 < k < n such that 2*n - a(k)- 1 and 2*n - a(k) + 1 are twin primes. Also, every n = 3, 4, ... can be written as p + a(k)/2 with p a prime and k an integer greater than one. - Zhi-Wei Sun, Jun 29-30 2013.
The number of configurations that realize this minimal diameter, is A083409(n). - Jeppe Stig Nielsen, Jul 26 2018
Engelsma points out that the values he lists past a(342)=2328 are only the "best known" values, and are not confirmed as minimal. - Brian Kehrig, Mar 21 2025

References

  • R. K. Guy, "Unsolved Problems in Number Theory", lists a number of relevant papers in Section A8.
  • John Leech, "Groups of primes having maximum density", Math. Tables Aids to Comput., 12 (1958) 144-145.

Crossrefs

Equals A020497 - 1.
Cf. A083409.

Formula

s(k), k >= 2, is smallest s such that there exist B = {b_1, b_2, ..., b_k} with s = b_k - b_1 and such that for all primes p <= k, not all residues modulo p are represented by B.

Extensions

Correction from Pat Weidhaas (weidhaas(AT)wotan.llnl.gov), Jun 15 1997
Edited by Daniel Forgues, Aug 13 2009
a(1)=0 prepended by Max Alekseyev, Aug 14 2015

A186311 Least k such that the interval 100k to 100k+99 has exactly n primes.

Original entry on oeis.org

16718, 1559, 3020, 588, 314, 188, 186, 59, 48, 41, 21, 13, 11, 19, 5, 8, 2, 4, 1228537713709, 14688670051164208, 203860951641372730864, 1
Offset: 0

Views

Author

T. D. Noe, Feb 22 2011

Keywords

Comments

It is known that a(25)=0. Terms for n = 22 and 23 are unknown. Glaisher tabulates the number of centuries having 0, 1, 2, ... primes for numbers up to 9000000. Glaisher's 1883 book is still in print!
a(24) does not exist because the only century having 24 primes is 0 to 99 -- the same century having 25 primes. From A020497, we see that a range of 101 numbers is required to find 24 primes. Dickson's conjecture implies that a(n) exists for n=18..23. - Charles R Greathouse IV, Feb 24 2011
To see that Dickson's conjecture is applicable to the preceding statement, the appropriate general sequence to consult is A364678, which affirms that 23 primes are permissible between adjacent multiples of 100, as opposed to in an arbitrary interval of 99 integers. - Peter Munn, Sep 04 2023
a(n) for n = 18..23 is greater than 10^10. Ribenboim discusses Dickson's conjecture in two books. - T. D. Noe, Feb 24 2011
a(19) <= 1108851311300675700427. - Donovan Johnson, Feb 28 2011
a(20) <= 394338677302163715754576644. - Tim Johannes Ohrtmann, Aug 27 2015

References

  • James Glaisher, Factor Table for the Sixth Million, Taylor and Francis, London, 1883.
  • Paulo Ribenboim, The New Book of Prime Number Records, Springer-Verlag NY, 1995, p. 372.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY, 2004, p. 250.

Crossrefs

Cf. A038822 (number of primes between 100n and 100n+99).
Cf. A181098 (centuries without primes).
Cf. A186393-A186408 (centuries having 1 to 16 primes).
Cf. A186509 (centuries having 17 primes).
Cf. A361723 (centuries having 18 primes).

Programs

  • Mathematica
    t = Differences[PrimePi[100*Range[0, 20000]]]; Flatten[Table[Position[t, n, 1, 1], {n, 0, 17}] - 1]
  • PARI
    a(n)=for(k=0,9e99,if(sum(i=100*k+1,100*k+99,ispseudoprime(i))==n, return(k))) \\ Charles R Greathouse IV, Feb 24 2011

Extensions

a(18) from Donovan Johnson, Feb 28 2011
a(19) from Brian Kehrig, Apr 08 2023
a(20)-a(21) from Brian Kehrig, May 28 2024

A023193 a(n) gives the largest number k for which there is at least one admissible k-tuple taken from [0, 1, ..., n-1] if the tuple starts with 0. Admissibility is defined in a comment.

Original entry on oeis.org

1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20
Offset: 1

Views

Author

Keywords

Comments

The (wrong) old name was: Largest number of pairwise coprime numbers that can occur in an interval of length n. - Wolfdieter Lang, Oct 10 2017
Conjecturally, a(n) is the largest number of primes that occurs on an infinite number of intervals of n consecutive integers. The conjecture is apparently due to Dickson; Hardy & Littlewood's Conjecture B concerns only pairs (p, p + 2n).
According to the link at www.opertech.com, a(3159) >= 447 > 446 = pi(3159). The k-tuples conjecture then implies that, for an infinitude of n, the interval [n+1, n+3159] includes 447 primes. For these n, pi(n+3159) >= pi(n)+447 > pi(n)+446 = pi(n)+pi(3159), contradicting the conjecture that pi(x+y) <= pi(x)+pi(y). - David W. Wilson, May 23 2005
From Wolfdieter Lang, Oct 10 2017: (Start)
The following admissibility definition is adapted from the Hensley and Richards [H-R] or Richards [R] links. A k-tuple B_k = [b_1, b_2, ..., b_k] of integers with 0 <= b_1 < b_2 < ... < b_k is admissible if, for each prime p, there exists at least one congruence class modulo p which contains none of the B_k members. Because complete residue systems modulo p are equivalent under translation one can consider the length n interval [0, 1, ..., n-1] and admissible k-tuples starting with 0. The prime p = 2 allows then only even tuple numbers from I_n = [0, 2, ..., floor((n-1)/2)]. Only primes p <= k have to be tested.
a(n) is then the maximal k for which there is at least one such admissible B_k tuple from the interval I_n. This function a(n) is called rho^* in (H-R) and (R). It has been given as rhobar in the Schinzel - Sierpiński link, Théorème 1, p. 201.
Note that there are also admissible k-tuples from members of [0, 1, ..., n-1] which do not start with 0. Such tuples are translations of the ones starting with 0. E.g., [1, 3] is an admissible 2-tuple for any [0, 1,..., n-1] interval with n >= 3, but it is a translation of the considered [0, 2] tuple.
For the multiplicities of k see A047947(k), for k >= 1.
For the smallest k such that a(k) = n see A020497(n), for k >= 1.
For the number of all admissible k-tuples from the interval I_n starting with 0 see the array A292224(n, k), with k = 1..a(n), which has been given in the Engelsma link, Table 2, p. 27.
One of the Hardy-Littlewood conjectures (the prime tuple conjecture, see also conjecture (B) given by [H-R] and [R], and Ribenboim, hypothesis (D_1), p. 373, from the Dickson conjecture) is that there are infinitely many primes with gaps defined by any admissible B_k tuple, that is, all p, p + b_2, ..., p + b_k are prime for infinitely many primes p, for k >= 2. For k = 1 this is well known.
(End)

References

  • Douglas Hensley and Ian Richards, "On the incompatibility of two conjectures concerning primes". Analytic number theory (Proc. Sympos. Pure Math., Vol. XXIV, St. Louis Univ., St. Louis, Mo., 1972), pp. 123-127.
  • P. Ribenboim, The New Book of Prime Number Records, Springer-Verlag, NY, 1996, ch. 6, I, pp. 372-386.

Crossrefs

Cf. A008407 (minimal difference of first and last prime in a prime k-tuplet), A047947 (multiplicities), A066081 (weaker binary conjectures), A062571.
Least inverse is A020497.

Formula

Conjecturally, a(n) = lim sup pi(x+n)-pi(x), where pi = A000720. This would follow from the k-tuple conjecture. - David W. Wilson, May 23 2005
a(n) = minimum m such that A008407(m) >= n. - Max Alekseyev, Nov 03 2008
Richards shows that a(n) > n/log n + kn/log^2 n + o(n/log^2 n), where k = 1 + log 2 = 1.69... . In particular, a(n) > pi(n) for large enough n. Hensley & Richards 1974 cite a result of Montgomery & Vaughan "to appear" that a(n) <= 2*pi(n) for n >= 2. - Charles R Greathouse IV, Apr 16 2013

Extensions

Name corrected by Wolfdieter Lang, Oct 10 2017

A065688 First prime in the smallest (nontrivial) prime k-tuplet.

Original entry on oeis.org

2, 3, 5, 5, 5, 7, 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 29, 29, 19, 19
Offset: 1

Views

Author

Frank Ellermann, Dec 04 2001

Keywords

Comments

For a proper definition see the cross-references.

Examples

			a(8): 11 13 17 19 23 29 31 37 are primes and 37-11=26=A008407(8).
		

Crossrefs

Cf. A008407 (minimal difference of first and last prime in a prime k-tuplet), A023193 (prime k-tuplet conjectures), A047947 (Schinzel's rhobar), A020497.
Cf. A261324 (another variant including trivial tuplets).

Extensions

a(1) prepended and a(20)-a(23) added by Max Alekseyev, Aug 15 2015

A135311 A greedy sequence of prime offsets.

Original entry on oeis.org

0, 2, 6, 8, 12, 18, 20, 26, 30, 32, 36, 42, 48, 50, 56, 62, 68, 72, 78, 86, 90, 96, 98, 102, 110, 116, 120, 128, 132, 138, 140, 146, 152, 156, 158, 162, 168, 176, 182, 186, 188, 198, 200, 210, 212, 216, 230, 240, 242, 246, 252, 260, 266, 270, 272, 278, 282
Offset: 1

Views

Author

galathaea(AT)gmail.com, Dec 07 2007

Keywords

Comments

Given a(i) for 1 <= i < n, a(n) is the smallest number > a(n-1) such that, for every prime p, the set {a(i) mod p : 1<=i<=n} has at most p-1 elements. Assuming Schinzel's hypothesis H, an equivalent statement is that a(n) is minimal such that there are infinitely many primes p with p+a(i) prime for 1 <= i <= n.
For every n, a(n) is not congruent to 1 (mod 2), nor to 1 (mod 3), nor to 4 (mod 5), nor to 3 (mod 7), ...
Note that this sequence does not always give the minimal difference between the first and last of n consecutive large primes, A008407. E.g., a(6)=18 but the 6 consecutive primes 97, 101, 103, 107, 109, 113 give the minimal difference of 16.

Examples

			Given a(1) through a(5), a(6) can't be 14 since the set {0,2,6,8,12,14} contains elements from every residue class (mod 5). a(6) can't be 16 because {0,2,6,8,12,16} contains elements from every residue class (mod 3). a(6)=18 is possible, since the residues (mod 2) are all 0, the residues (mod 3) are all 0 or 2 and the residues (mod 5) are all 0, 1, 2, or 3.
		

Crossrefs

Programs

  • Mathematica
    a[1]=0;a[n_]:=a[n]=Module[{v,set,ok,p},For[v=a[n-1]+2,True,v+=2,set=Append[a/@Range[n-1],v]; For[p=3;ok=True,p<=n,p+=2,If[PrimeQ[p]&&Length[Union[Mod[set,p]]]==p,ok=False;Break[]]];If[ok,Return[v]]]]
  • PARI
    {greedy()=local(A, L, B, n, v , ok , R, setR, p, k);
    A=vector(2089); \\ 2089 is the length to get Sum_{i>=2}(1/A[i])>2; see Ford, Luca, Moree paper, p. 1454
    L=length(A); B = 10^(5); \\ upper bound for the number of primes used; enough for the first 2089 terms
    A[1]=0;  \\ first trivial term;
    for (n=2, L,
    R=vector(n);
    forstep (v=A[n-1]+2, B, 2 , ok=1;
    forprime(p = 2, v,
    for(k=1,n-1, R[k]=A[k]%p);
    R[n]=v%p;
    setR=Set(R);
    if (length(setR) > p-1, ok=0; break);  \\ v is not good
    );
    if (ok==1, A[n]=v; break);
    );
    );
    return(A)
    } \\ Alessandro Languasco, Aug 11 2019

Extensions

Edited by Dean Hickerson, Dec 07 2007

A083409 Number of prime k-tuplet constellations, i.e., patterns with minimal diameter A008407.

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 3, 4, 2, 2, 2, 6, 2, 4, 2, 4, 2, 4, 2, 2, 4, 2, 4, 18, 2, 8, 10, 2, 2, 2, 4, 14, 20, 2, 2, 2, 6, 26, 26, 8, 2, 6, 18, 4, 4, 4, 2, 2, 22, 22, 2, 2, 26, 6, 6, 2, 2, 4, 2, 2, 6, 2, 2, 2, 2, 18, 2, 20, 2, 2, 2, 10, 2, 14, 14, 40, 8, 2, 14, 14, 16, 4, 2, 2, 60, 50, 2, 2, 2, 16, 2, 18, 12
Offset: 2

Views

Author

Frank Ellermann, Jun 07 2003

Keywords

Examples

			For a(8) = 3 octuplet patterns see A065706. for a(6) = 1 sextet see A061671.
		

Crossrefs

Extensions

More terms from Engelsma's website sent by T. D. Noe, Jul 21 2006

A020498 a(n) is the least number > a(n-1) such that there is no prime p for which a(1) through a(n) would contain all residues modulo p.

Original entry on oeis.org

1, 3, 7, 9, 13, 19, 21, 27, 31, 33, 37, 43, 49, 51, 57, 63, 69, 73, 79, 87, 91, 97, 99, 103, 111, 117, 121, 129, 133, 139, 141, 147, 153, 157, 159, 163, 169, 177, 183, 187, 189, 199, 201, 211, 213, 217, 231, 241, 243, 247, 253, 261, 267, 271, 273, 279, 283, 289
Offset: 1

Views

Author

Keywords

Comments

Conjecturally, a(n) is the smallest number such that n primes occur infinitely often among (x+a(1), ...,x+a(n)).
From M. F. Hasler, Nov 25 2024: (Start)
For a given prime p, if r is the only residue (mod p) not among {a(1), ..., a(n)} (mod p) for some index n, then no term of the sequence can be congruent to r (mod p).
(Instead of a(1...n), one can consider any collection of terms.) - Examples:
(1) p = 2, r = 0, n = 1: No term can be congruent to 0 (mod 2), i.e., even.
(2) p = 3, r = 2, n = 2: No term may be congruent to 2 (mod 3).
(3) p = 5, r = 0, n = 4: No term may be a multiple of 5.
(4) p = 7, r = 4, n = 6: No term may be congruent to 4 (mod 7).
(5) p = 11, r = 6, n = 11: No term may be congruent to 6 (mod 11). (End)

Examples

			From _M. F. Hasler_, Nov 25 2024: (Start)
a(2) can't be 2 because otherwise for the prime p = 2, we would have {a(1), a(2)} == {0, 1} (mod p), a complete set of residues. (For the same reason, no other term can be even.) So a(2) = 3 is the smallest possible choice.
Similarly, a(3) must be odd but not congruent to 2 (mod 3) (*), otherwise {a(1), a(2), a(3)} would form a complete set of residues (mod 3). (* As before, this holds for all terms of the sequence.)
  So 5 is excluded and the smallest choice is a(3) = 7. (End)
		

References

  • R. K. Guy's "Unsolved Problems in Number Theory" (2nd edition, Springer, 1994), Section A9.

Crossrefs

Programs

  • PARI
    upto(N, a=[1])={for(n=2, N, forstep(k=a[n-1]+2, oo, 2, forprime(p=3, n, #Set(concat(a,k)%p)==p && next(2)); a=concat(a,k); break));a} \\ M. F. Hasler, Nov 25 2024

Extensions

More terms from David Wasserman, Aug 17 2005
Old name has been interchanged with Wasserman's comment, as old name only a conjectural definition of the sequence. Edited by Christopher J. Smyth, May 12 2016
Definition reworded by M. F. Hasler, Nov 25 2024

A186634 Irregular triangle, read by rows, giving dense patterns of n primes.

Original entry on oeis.org

0, 2, 0, 2, 6, 0, 4, 6, 0, 2, 6, 8, 0, 2, 6, 8, 12, 0, 4, 6, 10, 12, 0, 4, 6, 10, 12, 16, 0, 2, 6, 8, 12, 18, 20, 0, 2, 8, 12, 14, 18, 20, 0, 2, 6, 8, 12, 18, 20, 26, 0, 2, 6, 12, 14, 20, 24, 26, 0, 6, 8, 14, 18, 20, 24, 26, 0, 2, 6, 8, 12, 18, 20, 26, 30, 0, 2, 6, 12, 14, 20, 24, 26, 30, 0, 4, 6, 10, 16, 18, 24, 28, 30, 0, 4, 10, 12, 18, 22, 24, 28, 30, 0, 2, 6, 8, 12, 18, 20, 26, 30, 32, 0, 2, 6, 12, 14, 20, 24, 26, 30, 32
Offset: 2

Views

Author

T. D. Noe, Feb 24 2011

Keywords

Comments

The first pattern (0,2) is for twin primes (p,p+2). Row n contains A083409(n) patterns, each one consisting of 0 followed by n-1 terms. In each row the patterns are in lexicographic order.
These numbers (in a slightly different order) appear in Table 1 of the paper by Tony Forbes. Sequence A186702 gives the least prime starting a given pattern.

Examples

			The irregular triangle begins:
0, 2
0, 2, 6, 0, 4, 6
0, 2, 6, 8
0, 2, 6, 8, 12, 0, 4, 6, 10, 12
0, 4, 6, 10, 12, 16
0, 2, 6, 8, 12, 18, 20, 0, 2, 8, 12, 14, 18, 20
		

Crossrefs

Showing 1-10 of 21 results. Next