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

A014085 Number of primes between n^2 and (n+1)^2.

Original entry on oeis.org

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

Views

Author

Jon Wild, Jul 14 1997

Keywords

Comments

Suggested by Legendre's conjecture (still open) that for n > 0 there is always a prime between n^2 and (n+1)^2.
a(n) is the number of occurrences of n in A000006. - Philippe Deléham, Dec 17 2003
See the additional references and links mentioned in A143227. - Jonathan Sondow, Aug 03 2008
Legendre's conjecture may be written pi((n+1)^2) - pi(n^2) > 0 for all positive n, where pi(n) = A000720(n), [the prime counting function]. - Jonathan Vos Post, Jul 30 2008 [Comment corrected by Jonathan Sondow, Aug 15 2008]
Legendre's conjecture can be generalized as follows: for all integers n > 0 and all real numbers k > K, there is a prime in the range n^k to (n+1)^k. The constant K is conjectured to be log(127)/log(16). See A143935. - T. D. Noe, Sep 05 2008
For n > 0: number of occurrences of n^2 in A145445. - Reinhard Zumkeller, Jul 25 2014

Examples

			a(17) = 5 because between 17^2 and 18^2, i.e., 289 and 324, there are 5 primes (which are 293, 307, 311, 313, 317).
		

References

  • J. R. Goldman, The Queen of Mathematics, 1998, p. 82.

Crossrefs

First differences of A038107.
Counts of primes between consecutive higher powers: A060199, A061235, A062517.

Programs

  • Haskell
    a014085 n = sum $ map a010051 [n^2..(n+1)^2]
    -- Reinhard Zumkeller, Mar 18 2012
    
  • Mathematica
    Table[PrimePi[(n + 1)^2] - PrimePi[n^2], {n, 0, 80}] (* Lei Zhou, Dec 01 2005 *)
    Differences[PrimePi[Range[0,90]^2]] (* Harvey P. Dale, Nov 25 2015 *)
  • PARI
    a(n)=primepi((n+1)^2)-primepi(n^2) \\ Charles R Greathouse IV, Jun 15 2011
    
  • Python
    from sympy import primepi
    def a(n): return primepi((n+1)**2) - primepi(n**2)
    print([a(n) for n in range(81)]) # Michael S. Branicky, Jul 05 2021

Formula

a(n) = A000720((n+1)^2) - A000720(n^2). - Jonathan Vos Post, Jul 30 2008
a(n) = Sum_{k = n^2..(n+1)^2} A010051(k). - Reinhard Zumkeller, Mar 18 2012
Conjecture: for all n>1, abs(a(n)-(n/log(n))) < sqrt(n). - Alain Rocchelli, Sep 20 2023
Up to n=10^6 there are no counterexamples to this conjecture. - Hugo Pfoertner, Dec 16 2024
Sorenson & Webster show that a(n) > 0 for all 0 < n < 7.05 * 10^13. - Charles R Greathouse IV, Jan 31 2025

A143898 Number of primes between n^K and (n+1)^K, where K = log(1151)/log(95).

Original entry on oeis.org

1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 1, 1, 3, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 3, 2, 1, 2, 3, 2, 1, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 1, 2, 2, 3, 2, 3, 3, 1, 4, 2, 3, 2, 1, 3, 2, 3, 2, 2, 2, 4, 1, 4, 2, 2, 2, 2, 3, 2, 3, 2, 4, 3, 2, 3, 3, 3, 3, 1, 3, 3, 2, 3, 3, 2, 3, 5, 3, 1, 1
Offset: 1

Views

Author

T. D. Noe, Sep 04 2008, Sep 26 2009, Oct 21 2009

Keywords

Comments

This value of K is conjectured to be the least possible such that there is at least one prime in the range n^K to (n+1)^K for n > 0. This value of K was found using exact interval arithmetic. For each n <= 110 and for each prime p in the range n to n^1.7, we computed an interval k(n,p) such that p is between n^k(n,p) and (n+1)^k(n,p). The intersection of all these intervals produces a list of intervals. The least value in those intervals is K, which is log(1151)/log(95). We computed 10^5 terms of this sequence to give us confidence that a(n) > 0 for all n.
More details about the algorithm: The n^1.7 limit was chosen because we were fairly certain that K would be less than 1.7. Let k(n) be the union of the intervals k(n,p) for p < n^1.7. Then k(n) is the set of exponents e such that the range n^e to (n+1)^e always contains a prime. Let k be the intersection of all the k(n) intervals for n up to N. Then k is the set of exponents e such that there is always a prime in the range n^e to (n+1)^e for n <= N. The number K is the least number in the set k. It appears that as N becomes larger, the set k converges. See A143935. - T. D. Noe, Sep 08 2008
The constant log(1151)/log(95) is A194362. - John W. Nicholson, Nov 25 2013
1151 counts as a qualifying prime towards both a(94)=1 and a(95)=3, in accordance with use of closed ranges. If prime p were counted only when n^K < p <= (n+1)^K, then term 95 would be 2. If prime p were counted only when n^K <= p < (n+1)^K, then term 94 would be 0. The conjecture in the author's comment implies K is the greatest real value such that for all e <= K there exists n > 0 with no prime p satisfying n^e <= p < (n+1)^e. - Peter Munn, Mar 02 2017
The author's description of the calculation of K implies that K is not an isolated qualifying value; equivalently that K is also the least real value for which there is a positive epsilon such that for all exponent e, K <= e <= K+epsilon and integer n > 0 there is a prime p satisfying n^e <= p <= (n+1)^e. This is a necessary precondition for my Mar 02 2017 deduction from the author's conjecture. - Peter Munn, Aug 21 2019

Crossrefs

A014085 (number of primes between n^2 and (n+1)^2), both A134034 and A143935 use a larger K.

Programs

  • Mathematica
    k= 1.547777108714197624815033; Table[Length[Select[Range[Ceiling[n^k],Floor[(n+1)^k]], PrimeQ]], {n,150}] (* T. D. Noe, Sep 08 2008 *)

Extensions

Removed some comments which changed the definition of this sequence. - N. J. A. Sloane, Oct 21 2009

A166363 Number of primes in the half-open interval (n*(log(n))^2..(n+1)*(log(n+1))^2].

Original entry on oeis.org

0, 2, 2, 1, 3, 1, 2, 3, 2, 2, 3, 2, 2, 4, 1, 2, 3, 3, 3, 3, 2, 2, 5, 2, 3, 4, 1, 3, 3, 3, 4, 3, 3, 3, 4, 3, 3, 4, 1, 3, 3, 5, 3, 4, 4, 3, 3, 3, 4, 3, 3, 4, 4, 4, 2, 3, 4, 3, 3, 4, 5, 3, 5, 4, 2, 3, 3, 6, 2, 4, 5, 3, 2, 2, 3, 6, 3, 6, 3, 4, 4, 6, 3, 4, 3, 4, 4, 4, 2, 3, 6, 3, 3, 2, 6, 5, 2, 6, 3, 5, 3, 2, 5, 4, 4
Offset: 1

Views

Author

Daniel Forgues, Oct 12 2009

Keywords

Comments

The open-closed half-open intervals form a partition of the real line for x > 0, thus each prime appears in a unique interval.
The n-th interval length is ~ (log(n+1/2))^2 + 2*log(n+1/2) ~ (log(n))^2 as n goes to infinity.
The n-th interval prime density is ~ 1/[log(n+1/2)+2*log(log(n+1/2))] ~ 1/log(n) as n goes to infinity.
The expected number of primes in the n-th interval is ~ [(log(n+1/2))^2 + 2*log(n+1/2)] / [log(n+1/2)+2*log(log(n+1/2))] ~ log(n) as n goes to infinity.
For n = 1 there is no prime.
If it can be proved that each interval always contains at least one prime, this would constitute even shorter intervals than A166332(n), let alone A143898(n), as n gets large.
The Shanks Conjecture and the Cramer-Granville Conjecture tell us that the intervals of length (log(n))^2 are of very critical length (the constant M > 1 of the Cramer-Granville Conjecture definitely matters!). There seems to be some risk that one such interval does not contain a prime.
The Wolf Conjecture (which agrees better with numerical evidence) seems more in favor of each interval's containing at least one prime.
From Charles R Greathouse IV, May 13 2010: (Start)
Not all intervals > 1 contain primes!
a(n) = 0 for n = 1, 4977, 17512, 147127, 76082969 (and no others up to 10^8).
Higher values include 731197850, 2961721173, 2103052050563, 188781483769833, 1183136231564246 but this list is not exhaustive.
The intervals have length (log n)^2 + 2*log n + o(1). In the Cramer model, the probability that a given integer in the interval would be prime is approximately 1/(log n + 2*log log n). Tedious calculation gives the probability that a(n) = 0 in the Cramer model as 3C(log n)^2/n * (1 + o(1)) with C = exp(-5/2)/3. Thus under that model we would expect to find roughly C*(log N)^3 numbers n up to N with a(n) = 0. In fact, the numbers are not that common since the probabilities are not independent.
(End)
The similar sequence A345755 relies on intervals that are slightly more than twice as wide as those in the present sequence. A345755 does not include zero entries for n <= 2772, suggesting that the lengths of prime gaps may be bracketed by the two sequences. We conjecture that prime gaps may be larger than log(p)^2, but are not larger than log_2(p)^2. - Hal M. Switkay, Aug 29 2023

Crossrefs

Cf. A166332, A000720, A111943, A143898, A134034, A143935, A144140 (primes between successive n^K, for different K), A014085 (primes between successive squares).

Programs

Formula

a(n) = pi((n+1)*(log(n+1))^2) - pi(n*(log(n))^2) since the intervals are half-open properly.

Extensions

Edited by Daniel Forgues, Oct 18 2009 and Nov 01 2009
Edited by Charles R Greathouse IV, May 13 2010

A144140 Numbers n such that between n^K and (n+1)^K there are no primes, where K = 3/2.

Original entry on oeis.org

10, 20, 24, 27, 32, 65, 121, 139, 141, 187, 306, 321, 348, 1006, 1051
Offset: 1

Views

Author

Artur Jasinski, Sep 11 2008

Keywords

Comments

Conjecture: this sequence is finite and complete

Crossrefs

Programs

  • Maple
    select(n -> numtheory:-pi(floor((n+1)^(3/2))) = numtheory:-pi(ceil(n^(3/2)-1)), [$1..10000]); # Robert Israel, Feb 02 2016
  • Mathematica
    a = {}; k = 3/2; Do[If[Length[Select[Range[Ceiling[n^k], Floor[(n + 1)^k]], PrimeQ]] == 0, Print[n]; AppendTo[a, n]], {n, 10000}]; a

A144256 a(n) = smallest prime in the range [n^K, (n+1)^K], where K = log(127)/log(16) = 1.74717117169304146332...

Original entry on oeis.org

2, 5, 7, 13, 17, 23, 31, 41, 47, 59, 67, 79, 89, 101, 127, 127, 149, 157, 173, 191, 211, 223, 241, 263, 277, 307, 317, 347, 359, 383, 409, 431, 457, 479, 499, 541, 557, 577, 607, 631, 659, 691, 719, 751, 787, 809, 839, 877, 907, 937, 967, 997, 1031, 1069
Offset: 1

Views

Author

Keywords

Comments

T. D. Noe submitted to primepuzzles.net the following conjecture #60, which is stronger than the Legendre's conjecture: For n>0 and k>=K, there is always a prime between n^k and (n+1)^k, where K = log(127)/log(16) = 1.74717117169304146332...
One could see that calculated terms for n=15 and n=16 yield the same value: 127, which make this conjecture (as originally defined) to be questionable. If this conjecture is modified to k>K, then there will be a distinct prime between 15^k and 16^k. It appears that the relatively large prime gap between 113 and 127 is the largest gap to overcome. Another way to correct/clarify the conjecture is to mention that both boundaries of the interval are included and that the same prime value may appear in two neighboring intervals. Of course the last version of the modified definition makes this conjecture to be different from the original Legendere conjecture (rather than to be an improvement of the original Legendere conjecture). [Alexander R. Povolotsky, Sep 26 2008]
The constant log(127)/log(16) is A194361. - John W. Nicholson, Dec 13 2013

Crossrefs

Programs

  • Mathematica
    k = Log[127]/Log[16]; Table[Select[Range[Ceiling[n^k], Floor[(n + 1)^k]], PrimeQ, 1][[1]], {n, 100}] (* T. D. Noe, Jan 30 2012 *)
  • PARI
    i=[];for(n=1, 500, for(j=ceil(n^(log(127)/log(16))), ceil((n+1)^(log(127)/log(16))), if(isprime(j), i=concat(i,j)); if(isprime(j), break)));i

Extensions

Extended by T. D. Noe, Jan 30 2012

A166332 Number of primes in (n^(3/2)*(log(n))^(1/2)..(n+1)^(3/2)*(log(n+1))^(1/2)] semi-open intervals, n >= 1.

Original entry on oeis.org

1, 2, 1, 2, 2, 1, 2, 1, 3, 1, 2, 3, 2, 1, 3, 3, 1, 3, 2, 3, 3, 2, 2, 2, 4, 2, 3, 4, 1, 4, 1, 4, 2, 4, 2, 3, 4, 4, 2, 4, 3, 1, 3, 4, 4, 4, 4, 3, 3, 3, 4, 3, 3, 3, 5, 4, 4, 2, 3, 3, 5, 3, 5, 5, 4, 4, 2, 3, 4, 5, 3, 5, 5, 2, 3, 2, 5, 5, 6, 3, 4, 5, 6, 3, 4, 4, 4, 4, 5, 2, 5, 5, 3, 3, 6, 5, 3, 6, 6, 3, 3, 4, 5, 5, 5
Offset: 1

Views

Author

Daniel Forgues, Oct 12 2009

Keywords

Comments

Number of primes in (n*(n*log(n))^(1/2)..(n+1)*((n+1)*log(n+1))^(1/2)] semi-open intervals, n >= 1.
The semi-open intervals form a partition of the real line for x > 0, thus each prime appears in a unique interval.
a(n) = pi((n+1)^(3/2)*(log(n+1))^(1/2)) - pi(n^(3/2)*(log(n))^(1/2)) since the intervals are semi-open properly.
The n-th interval length is: ~ (1/2)*(n+1/2)^(1/2)*(3*(log(n+1/2))^(1/2)+(log(n+1/2))^(-1/2)) ~ (3/2)*n^(1/2)*(log(n))^(1/2) as n goes to infinity.
The n-th interval prime density is: ~ 2/(3*log(n+1/2)+log(log(n+1/2))) ~ 2/(3*log(n)) as n goes to infinity.
The expected number of primes for n-th interval is: ~ (n+1/2)^(1/2)*(3*(log(n+1/2))^(1/2)+(log(n+1/2))^(-1/2))/ (3*log(n+1/2)+log(log(n+1/2))) ~ n^(1/2)/(log(n))^(1/2) as n goes to infinity.
Using Excel 2003, for n in [1..1123], I obtain a(n) >= 1 (at least one prime per interval).
CAUTION: I will submit the b-file, but since Excel 2003 is limited to 15-digit precision, the rounding might assign to the wrong interval a prime which is extremely close to the limit of 2 successive intervals. The b-file NEEDS TO BE VERIFIED using interval arithmetic! (SEE NEXT)
CAUTION (ADDENDA): for n in [1..1123], the minimum ratio of... ABS(n^(3/2)*(log(n))^(1/2)-ROUND(n^(3/2)*(log(n))^(1/2)))/(n^(3/2)*(log(n))^(1/2)) that I got is 5.04999E-09 which is well above 1E-15 (15-digit limit of Excel 2003), so no interval ended too close to an integral value and every prime has then been assigned to its proper interval. My b-file should then be reliable.
If it can be proved that each interval always contains at least one prime, this would constitute shorter intervals than A143898(n) as n gets large.
The sequence A166363 gives even shorter intervals that seem to always contain at least one prime (for n > 1)!

Crossrefs

Cf. A143898, A134034, A143935 (for primes between successive n^K, for different K).
Cf. A144140 (showing that for n^K, K=3/2, some intervals fails to contain primes).
Cf. A166363 (for primes in even shorter intervals).
Cf. A014085 (for primes between successive squares).
Cf. A000720.

Extensions

Corrected and edited by Daniel Forgues, Oct 14 2009
Edited by Daniel Forgues, Oct 20 2009

A194361 Decimal expansion of log(127) / log(16).

Original entry on oeis.org

1, 7, 4, 7, 1, 7, 1, 1, 7, 1, 6, 9, 3, 0, 4, 1, 4, 6, 3, 3, 2, 0, 0, 0, 0, 9, 7, 3, 0, 7, 5, 4, 2, 5, 6, 9, 2, 4, 2, 0, 3, 9, 1, 1, 6, 1, 7, 3, 7, 7, 9, 6, 6, 3, 3, 2, 3, 6, 0, 2, 5, 5, 1, 1, 7, 8, 1, 4, 5, 6, 5, 7, 6, 2, 2, 0, 5, 0, 4, 1, 0, 3, 2, 2, 7, 0, 1, 1, 4, 5, 1, 3, 0, 9, 6, 6, 9, 1, 9, 6, 5, 1, 0, 3, 2
Offset: 1

Views

Author

T. D. Noe, Oct 04 2011

Keywords

Examples

			1.747171171693041463320000973...
		

Crossrefs

Programs

  • Mathematica
    RealDigits[Log[127]/Log[16], 10, 105]
  • PARI
    log(127)/log(16) \\ G. C. Greubel, Feb 19 2017

A144137 Numbers n such that between n^K and (n+1)^K there are no primes, where K = sqrt(2).

Original entry on oeis.org

4, 24, 29, 33, 40, 43, 56, 59, 84, 117, 122, 128, 132, 139, 145, 156, 162, 163, 183, 190, 203, 230, 253, 257, 286, 297, 303, 306, 315, 319, 336, 371, 403, 420, 433, 447, 456, 467, 479, 537, 543, 563, 592, 595, 599, 624, 699, 746, 755, 767, 774, 782, 805, 814
Offset: 1

Views

Author

Artur Jasinski, Sep 11 2008

Keywords

Examples

			a(1)=4 because in range 4^sqrt(2) = 7.10299... and (4+1)^sqrt(2) = 9.73852... there are no primes (8 and 9 aren't primes).
		

Crossrefs

Programs

  • Mathematica
    a = {}; k = Sqrt[2]; Do[If[Length[Select[Range[Ceiling[n^k], Floor[(n + 1)^k]], PrimeQ]] == 0, AppendTo[a, n]], {n, 3000}]; a
    Select[Range[850],PrimePi[(#+1)^Sqrt[2]]-PrimePi[#^Sqrt[2]]==0&] (* or *) SequencePosition[PrimePi[Range[850]^Sqrt[2]],{x_,x_}][[All,1]] (* Harvey P. Dale, Jul 31 2021 *)

A345755 a(n) is the number of primes p satisfying n*(log_2(n))^2 < p <= (n+1)*(log_2(n+1))^2.

Original entry on oeis.org

1, 3, 2, 3, 3, 4, 4, 4, 5, 3, 4, 4, 6, 3, 5, 7, 3, 4, 6, 5, 5, 7, 5, 3, 6, 6, 7, 6, 4, 6, 5, 7, 5, 6, 5, 6, 7, 6, 8, 4, 6, 6, 9, 3, 5, 7, 9, 5, 7, 9, 4, 7, 7, 5, 7, 6, 5, 9, 7, 8, 3, 7, 8, 8, 8, 6, 4, 7, 6, 8, 10, 7, 8, 7, 6, 7, 6, 6, 6, 7, 7, 10, 4, 8, 9, 7
Offset: 1

Views

Author

Hal M. Switkay, Jun 27 2021

Keywords

Comments

Prime gaps appear to grow more slowly than any power function.
Cramér's conjecture states that prime gaps grow as follows: prime(n+1) - prime(n) = O(log(prime(n))^2).
Since prime(n) ~ n*log(n), we conjecture that a(n) > 0 for n > 0, and that the exponent 2 cannot be replaced by any smaller exponent.
Note: n*(log_2(n))^2 < n^(log(127)/log(16)) when n >= 267. Therefore the conjecture immediately above is stronger than the conjecture that A143935(n) > 0 when n > 0, which in turn is stronger than Legendre's conjecture.
This sequence relies on intervals that are slightly more than twice as wide as those in the similar sequence A166363. A comment at that sequence by Greathouse discovers zero values (representing prime-free intervals). In contrast, the present sequence does not include zero entries for n <= 2772, suggesting that the lengths of prime gaps may be bracketed by the two sequences. We conjecture that prime gaps may be larger than log(p)^2, but are not larger than log_2(p)^2. - Hal M. Switkay, Aug 29 2023

Examples

			a(10) is the number of primes > 110.35 and <= 131.64. a(10) = 3, because the primes in this interval are 113, 127, and 131.
		

Crossrefs

Programs

  • Mathematica
    Differences @ Table[PrimePi[n*Log2[n]^2], {n, 1, 100}] (* Amiram Eldar, Jun 27 2021 *)
  • PARI
    f(n) = n*(log(n)/log(2))^2;
    a(n) = primepi(f(n+1)) - primepi(f(n)); \\ Michel Marcus, Jun 30 2021
Showing 1-9 of 9 results.