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

A060715 Number of primes between n and 2n exclusive.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 2, 2, 3, 4, 3, 4, 3, 3, 4, 5, 4, 4, 4, 4, 5, 6, 5, 6, 6, 6, 7, 7, 6, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9, 10, 9, 10, 9, 9, 10, 10, 9, 9, 10, 10, 11, 12, 11, 12, 13, 13, 14, 14, 13, 13, 12, 12, 12, 13, 13, 14, 13, 13, 14, 15, 14, 14, 13, 13, 14, 15, 15
Offset: 1

Views

Author

Lekraj Beedassy, Apr 25 2001

Keywords

Comments

See the additional references and links mentioned in A143227. - Jonathan Sondow, Aug 03 2008
a(A060756(n)) = n and a(m) <> n for m < A060756(n). - Reinhard Zumkeller, Jan 08 2012
For prime n conjecturally a(n) = A226859(n). - Vladimir Shevelev, Jun 27 2013
The number of partitions of 2n+2 into exactly two parts where the first part is a prime strictly less than 2n+1. - Wesley Ivan Hurt, Aug 21 2013

Examples

			a(35)=8 since eight consecutive primes (37,41,43,47,53,59,61,67) are located between 35 and 70.
		

References

  • M. Aigner and C. M. Ziegler, Proofs from The Book, Chapter 2, Springer NY 2001.

Crossrefs

Related sequences:
Primes (p) and composites (c): A000040, A002808, A000720, A065855.
Primes between p(n) and 2*p(n): A063124, A070046; between c(n) and 2*c(n): A376761; between n and 2*n: A035250, A060715, A077463, A108954.
Composites between p(n) and 2*p(n): A246514; between c(n) and 2*c(n): A376760; between n and 2*n: A075084, A307912, A307989, A376759.

Programs

  • Haskell
    a060715 n = sum $ map a010051 [n+1..2*n-1]  -- Reinhard Zumkeller, Jan 08 2012
    
  • Magma
    [0] cat [#PrimesInInterval(n+1, 2*n-1): n in [2..80]]; // Bruno Berselli, Sep 05 2012
    
  • Maple
    a := proc(n) local counter, i; counter := 0; from i from n+1 to 2*n-1 do if isprime(i) then counter := counter +1; fi; od; return counter; end:
    with(numtheory); seq(pi(2*k-1)-pi(k),k=1..100); # Wesley Ivan Hurt, Aug 21 2013
  • Mathematica
    a[n_]:=PrimePi[2n-1]-PrimePi[n]; Table[a[n],{n,1,84}] (* Jean-François Alcover, Mar 20 2011 *)
  • PARI
    { for (n=1, 1000, write("b060715.txt", n, " ", primepi(2*n - 1) - primepi(n)); ) } \\ Harry J. Smith, Jul 10 2009
    
  • Python
    from sympy import primerange as pr
    def A060715(n): return len(list(pr(n+1, 2*n))) # Karl-Heinz Hofmann, May 05 2022

Formula

a(n) = Sum_{k=1..n-1} A010051(n+k). - Reinhard Zumkeller, Dec 03 2009
a(n) = pi(2n-1) - pi(n). - Wesley Ivan Hurt, Aug 21 2013
a(n) = Sum_{k=(n^2-n+2)/2..(n^2+n-2)/2} A010051(A128076(k)). - Wesley Ivan Hurt, Jan 08 2022

Extensions

Corrected by Dug Eichelberger (dug(AT)mit.edu), Jun 04 2001
More terms from Larry Reeves (larryr(AT)acm.org), Jun 05 2001

A080359 The smallest integer x > 0 such that the number of primes in (x/2, x] equals n.

Original entry on oeis.org

2, 3, 13, 19, 31, 43, 53, 61, 71, 73, 101, 103, 109, 113, 139, 157, 173, 181, 191, 193, 199, 239, 241, 251, 269, 271, 283, 293, 313, 349, 353, 373, 379, 409, 419, 421, 433, 439, 443, 463, 491, 499, 509, 523, 577, 593, 599, 601, 607, 613, 619, 647, 653, 659
Offset: 1

Views

Author

Labos Elemer, Feb 21 2003

Keywords

Comments

a(n) is the same as: Smallest integer x > 0 such that the number of unitary-prime-divisors of x! equals n.
Let p_n be the n-th prime. If p_n>3 is in the sequence, then all integers (p_n-1)/2, (p_n-3)/2, ..., (p_(n-1)+1)/2 are composite numbers. - Vladimir Shevelev, Aug 12 2009
For n >= 3, denote by q(n) the prime which is the nearest from the left to a(n)/2. Then there exists a prime between 2q(n) and a(n). The converse, generally speaking, is not true; i.e., there exist primes that are outside the sequence, but possess such property (e.g., 131). - Vladimir Shevelev, Aug 14 2009
See sequence A164958 for a generalization. - Vladimir Shevelev, Sep 02 2009
a(n) is the n-th Labos prime.

Examples

			n=5: in 31! five unitary-prime-divisors appear (firstly): {17,19,23,29,31}, while other primes {2,3,5,7,11,13} are at least squared. Thus a(5)=31.
Consider a(9)=71. Then the nearest prime < 71/2 is q(9)=31, and between 2q(9) and a(9), i.e., between 62 and 71 there exists a prime (67). - _Vladimir Shevelev_, Aug 14 2009
		

Crossrefs

Cf. A104272 (Ramanujan primes).
Cf. A060756, A080360 (largest integer x with n primes in (x/2,x]).

Programs

  • Mathematica
    nn=1000; t=Table[0, {nn+1}]; s=0; Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s<=nn && t[[s+1]]==0, t[[s+1]]=k], {k, Prime[3*nn]}]; Rest[t]
    (* Second program: *)
    a[1] = 2; a[n_] := a[n] = Module[{x = a[n-1]}, While[(PrimePi[x]-PrimePi[Quotient[x, 2]]) != n, x++ ]; x]; Array[a, 54] (* Jean-François Alcover, Sep 14 2018 *)
  • PARI
    a(n) = {my(x = 1); while ((primepi(x) - primepi(x\2)) != n, x++;); x;} \\ Michel Marcus, Jan 15 2014
    
  • Sage
    def A():
        i = 0; n = 1
        while True:
            p = prime_pi(i) - prime_pi(i//2)
            if p == n:
                yield i
                n += 1
            i += 1
    A080359 = A()
    [next(A080359) for n in range(54)] # Peter Luschny, Sep 03 2014

Formula

a(n) = Min{x; Pi[x]-Pi[x/2]=n} = Min{x; A056171(x)=n}=Min{x; A056169(n!)=n}; where Pi()=A000720().
a(n) <= A193507(n) (cf. A194186). - Vladimir Shevelev, Aug 18 2011

Extensions

Definition corrected by Jonathan Sondow, Aug 10 2008
Shrunk title and moved part of title to comments by John W. Nicholson, Sep 18 2011

A084140 a(n) is the smallest number j such that if x >= j there are at least n primes between x and 2x exclusively.

Original entry on oeis.org

2, 6, 9, 15, 21, 24, 30, 34, 36, 49, 51, 54, 64, 75, 76, 84, 90, 91, 114, 115, 117, 120, 121, 132, 135, 141, 154, 156, 174, 175, 184, 187, 201, 205, 210, 216, 217, 220, 231, 244, 246, 252, 285, 286, 294, 297, 300, 301, 304, 321, 322, 324, 327, 330, 339, 360, 364
Offset: 1

Views

Author

Harry J. Smith, May 15 2003

Keywords

Comments

For all m >= a(n) there are at least n primes between m and 2m exclusively. This calculation relies on the fact that pi(2m) - pi(m) > m/(3*log(m)) for m >= 5. This is one more than the terms of A084139 with offset changed from 0 to 1.
For n > 5889, pi(2n) - pi(n) > f(2, 2n) - f(3, n) where f(k, x) = x/log x * (1 + 1/log x + k/(log x)^2). This may be useful for checking larger terms. The constant 3 can be improved at the cost of an increase in the constant 5889. - Charles R Greathouse IV, May 02 2012
A168421(n) = nextprime(a(n)), where nextprime(x) is the next prime >= x. - John W. Nicholson, Dec 21 2012
a(1) = ceiling((A104272(1)+1)/2) modifies the only even prime, 2; which has been stated, in Formula, as a(1) = A104272(1); for all others, a(n) = (A104272(n)+1)/2 = ceiling ((A104272(n)+1)/2). - John W. Nicholson, Dec 24 2012
Srinivasan's Lemma (2014): previousprime(a(n)) = p_(k-n) < (p_k)/2, where the n-th Ramanujan Prime R_n is the k-th prime p_k, and with n > 1. Proof: By the minimality of R_n, the interval ((p_k)/2,p_k] contains exactly n primes, so p_(k-n) < (p_k)/2. - Copied and adapted from a comment by Jonathan Sondow in A168421 by John W. Nicholson, Feb 17 2015

Examples

			a(11)=51 since there are at least 11 primes between m and 2m for all m >= 51 and this is not true for any m < 51. Although a(100)=720 is not listed, for all m >= 720, there are at least 100 primes between m and 2m.
		

References

  • Paulo Ribenboim, The Little Book of Big Primes, Springer-Verlag, 1991, p. 140.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag, 2004, p. 181.

Crossrefs

Programs

Formula

a(1) = A104272(1); for n >= 2, a(n) = (A104272(n)+1)/2. - Vladimir Shevelev, Dec 07 2012
a(n) = ceiling((A104272(n)+1)/2) for n >= 1. - John W. Nicholson, Dec 24 2012

A084139 a(n) is the largest number for which exactly n primes are bounded between a(n) and 2a(n) exclusively.

Original entry on oeis.org

1, 5, 8, 14, 20, 23, 29, 33, 35, 48, 50, 53, 63, 74, 75, 83, 89, 90, 113, 114, 116, 119, 120, 131, 134, 140, 153, 155, 173, 174, 183, 186, 200, 204, 209, 215, 216, 219, 230, 243, 245, 251, 284, 285, 293, 296, 299, 300, 303, 320, 321, 323, 326, 329, 338, 359, 363
Offset: 0

Views

Author

Harry J. Smith, May 15 2003

Keywords

Comments

a(n) is the index of last occurrence of n in A060715. This calculation relies on the fact that Pi(2*m)-Pi(m) > m/(3*Log(m)) for m>=5. It can be shown that every integer >= 0 occurs in A060715, so there is no problem in finding the last occurrence.
A168421(n) = nextprime(a(n)), where nextprime(x) is the next prime > x. Note: some a(n) may be prime, therefore nextprime(x) not equal to x. - John W. Nicholson, Oct 11 2013

Examples

			a(10) = 50 since ten primes last arise between 50 and 100: 53, 59, 61, 67, 71, 73, 79, 83, 89, 97.
		

References

  • P. Ribenboim, The Little Book of Big Primes. Springer-Verlag, 1991, p. 140.

Crossrefs

Programs

  • Mathematica
    nn = 100; t = Table[0, {nn}]; Do[m = PrimePi[2*n] - PrimePi[n]; If[0 < m <= nn, t[[m]] = n], {n, 15*nn}]; Join[{1}, t] (* T. D. Noe, Dec 31 2012 *)

Formula

a(n) = floor((A104272(n)+1)/2) for n >= 1. - John W. Nicholson, Oct 11 2013
a(n) = A084140(n+1) - 1. - John W. Nicholson, Oct 11 2013

A084141 a(n) is the index in sequence A084138 when the value of that sequence is one (1), i.e., there is exactly one case where there are exactly a(n) primes between m and 2m, exclusively, for m > 0.

Original entry on oeis.org

0, 22, 36, 47, 79, 98, 114, 134, 173, 178, 184, 210, 218, 221, 245, 254, 262, 284, 297, 305, 327, 333, 373, 387, 396, 426, 459, 466, 470, 484, 530, 544, 563, 567, 575, 587, 616, 650, 694, 700, 706, 708, 737, 776, 859, 881, 885, 898, 926, 939, 974, 993, 1002
Offset: 0

Views

Author

Harry J. Smith, May 15 2003

Keywords

Comments

This calculation relies on the fact that Pi(2*m) - Pi(m) > m/(3*log(m)) for m >= 5. Conjecture: There are an infinite number of terms in this sequence.

Examples

			a(3)=47 because the 3rd one in sequence A084138 is its item 47. There is exactly one case where there are exactly 47 primes between m and 2m.
		

References

  • P. Ribenboim, The Little Book of Big Primes. Springer-Verlag, 1991, p. 140.

Crossrefs

A059316 Least integer m such that between m and 2m (including endpoints) there are exactly n primes.

Original entry on oeis.org

1, 2, 7, 10, 16, 22, 27, 31, 36, 37, 51, 52, 55, 57, 70, 79, 87, 91, 96, 97, 100, 120, 121, 126, 135, 136, 142, 147, 157, 175, 177, 187, 190, 205, 210, 211, 217, 220, 222, 232, 246, 250, 255, 262, 289, 297, 300, 301, 304, 307, 310, 324, 327, 330, 331, 342, 346
Offset: 1

Views

Author

Felice Russo, Jan 25 2001

Keywords

Comments

See A060756 for the case they are excluded. - R. J. Mathar, Nov 28 2007
A035250(a(n)) = n and A035250(m) <> n for m < a(n). - Reinhard Zumkeller, Jan 08 2012

Examples

			a(3)=7 because 7 is the least integer such that between 7 and 14 there are 3 primes.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (mapMaybe)
    a059316 n = a059316_list !! n
    a059316_list = map (+ 1) $ mapMaybe (`elemIndex` a035250_list) [1..]
    -- Reinhard Zumkeller, Jan 05 2012
  • Mathematica
    im[n_]:=Module[{m=1},While[PrimePi[2m]-(PrimePi[m-1])!=n,m++];m]; Array[  im,60]  (* Harvey P. Dale, May 19 2012 *)

A084138 a(n) is the number of times n is in sequence A060715, i.e., there are exactly a(n) cases where there are exactly n primes between m and 2m, exclusively, for m > 0.

Original entry on oeis.org

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

Views

Author

Harry J. Smith, May 15 2003

Keywords

Comments

This calculation relies on the fact that Pi(2*m) - Pi(m) > m/(3*log(m)) for m >= 5. It can be shown that a(n) is never zero, i.e., every nonnegative integer is in sequence A060715.

Examples

			a(22)=1 because there are 22 primes between 120 and 240 (namely, prime numbers p(31)=127 through p(52)=239), and in no other case are there exactly 22 primes between m and 2m exclusively.
		

References

  • P. Ribenboim, The Little Book of Big Primes. Springer-Verlag, 1991, p. 140.

Crossrefs

A084142 Positive numbers k such that the number of primes between k and 2*k is different from the number of primes between m and 2*m for every number m != k.

Original entry on oeis.org

1, 120, 216, 300, 531, 714, 804, 999, 1344, 1356, 1395, 1680, 1764, 1770, 1959, 2046, 2121, 2325, 2484, 2511, 2760, 2826, 3150, 3285, 3396, 3744, 4044, 4116, 4146, 4314, 4710, 4839, 5046, 5070, 5136, 5250, 5586, 5970, 6411, 6459, 6501, 6504, 6846, 7275
Offset: 1

Views

Author

Harry J. Smith, May 15 2003

Keywords

Comments

The number of primes between k and 2*k is unique because no other number m > 0 has the same of primes between m and 2m, exclusively. k is the value of A060756(j) or A084139(j) when A084138(j) = 1. Question: Is this sequence infinitely long?
If k > 1 is a term then A060715(k-1) < A060715(k) < A060715(k+1). Consequently, (2*k-1, 2*k+1) is a twin prime pair, so 3|k. Additionally, it can be shown that k-1..k+3 are all composite numbers. Moreover, if k is even, then k-4..k+4 are all composite numbers. - Jon E. Schoenfield, Oct 08 2023

Examples

			120 is a term because there are 22 primes between 120 and 240 and no other number m > 0 has 22 primes between m and 2*m.
		

References

  • P. Ribenboim, The Little Book of Big Primes. Springer-Verlag, 1991, p. 140.

Crossrefs

Extensions

Name edited by Jon E. Schoenfield, Oct 08 2023

A104380 Smallest prime p(i) such that between 2p(i) and 2p(i+1) there exist n primes.

Original entry on oeis.org

59, 2, 5, 31, 89, 509, 113, 1129, 1951, 7253, 19609, 16141, 13339, 28229, 1327, 281431, 396733, 1122287, 461717, 370261, 2010733, 492113, 3279841, 14246971, 3117299, 5826001, 20831323, 47326693, 60487759, 189695659, 191912783, 1301171033, 2044207843, 3129752191, 476956933, 836806669, 2433630109
Offset: 0

Views

Author

Ali A. Tanara (tanara(AT)khayam.ut.ac.ir) and Robert G. Wilson v, Mar 03 2005

Keywords

Examples

			a(0)=59 because between 2*59=118 and 2*61=122 there are no primes and 59 is the least prime with this characteristic.
a(4)=89 because between 2*89=178 and 2*97=194 there are 4 primes, namely 179, 181, 191 and 193.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := PrimePi[2Prime[n + 1]] - PrimePi[2Prime[n]]; t = Table[0, {30}]; Do[a = f[n]; If[t[[a + 1]] == 0, t[[a + 1]] = Prime[n]], {n, 2500000}]; t
  • PARI
    ct(a,b)=sum(k=a,b,isprime(k))
    a(n)=my(p=2); forprime(q=3,, if(ct(2*p+1,2*q-1)==n, return(p)); p=q) \\ Charles R Greathouse IV, Nov 05 2017

Extensions

a(27)-a(36) from Charles R Greathouse IV, Nov 05 2017

A124136 The list of primes p such that the number of primes in the open interval (p,2*p) is larger than the number of primes in the open interval (q,2*q) for all q

Original entry on oeis.org

2, 7, 11, 17, 23, 29, 31, 37, 53, 59, 71, 79, 89, 97, 101, 127, 137, 149, 157, 179, 191, 211, 223, 233, 251, 257, 263, 293, 307, 311, 331, 347, 367, 373, 379, 389, 409, 419, 431, 443, 457, 479, 487, 499, 521, 541, 547, 557, 563, 587, 599, 613, 617, 631, 641
Offset: 1

Views

Author

Jani Melik, Nov 30 2006

Keywords

Comments

Sequence A060715(n) lists the number of primes in the open interval (n,2*n).
If we extract its sublist for n a prime, the number of primes in the open interval (p,2*p), we have A070046(m) = 1, 1, 1, 2, 3, 3, 4, 4, 5, 6, 7, 9, 9, 9, 9, 11, 13, 12, 13, 14, 13, 15, 15, 16... for the primes p=2, 3, 5, 7, 11, 13, 17, 19 etc.
This sequence lists the primes p = prime(m) that set a new record in A070046(m).
Alternative definition: primes p defined by positions of records in A063124.

Examples

			a(1)=prime(1)=2 with 1 prime in the interval (2,4). a(2) is neither 3 (with 1 prime in the interval (3,6)), nor 5 (with 1 prime in the interval (5,10)), but a(2)=7 with 2 primes in the interval (7,14).
The primes 41, 43 and 47 are not in the list because the intervals (41,82), (43,86) and (47,94) contain 9 primes, but the interval (37,74) with the smaller prime p=37 already contained 9 primes.
The prime 53 is in the list because the interval (53,106) contains 11 primes and the intervals (q,2*q) for primes q =2,3, 5, ..,47 contained 9 or less primes.
		

Crossrefs

Programs

  • Maple
    ts_c:=proc(n) local i,j,st_p,max_stp,ans; ans:= [ ]: st_p:=0: max_stp:=0: for i from 2 to n do for j from i+1 to 2*i-1 do if (isprime(j) = 'true') then st_p:=st_p+1: fi od: if (st_p > max_stp and isprime(i) = 'true') then max_stp := st_p: ans:=[ op(ans),i ]: fi; st_p:=0: od: RETURN(ans) end: ts_c(1200);

Extensions

Definition recovered from the Maple program. - R. J. Mathar, May 21 2025
Showing 1-10 of 11 results. Next