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.

Previous Showing 11-20 of 114 results. Next

A224363 Primes p such that there are no squares between p and the prime following p.

Original entry on oeis.org

2, 5, 11, 17, 19, 29, 37, 41, 43, 53, 59, 67, 71, 73, 83, 89, 101, 103, 107, 109, 127, 131, 137, 149, 151, 157, 163, 173, 179, 181, 191, 197, 199, 211, 227, 229, 233, 239, 241, 257, 263, 269, 271, 277, 281, 293, 307, 311, 313, 331, 337, 347, 349, 353, 367, 373
Offset: 1

Views

Author

César Aguilera, Apr 04 2013

Keywords

Comments

Legendre's Conjecture states that there is a prime between n^2 and (n+1)^2 for every integer n > 0 and thus that between two adjacent primes there can be at most one square. As of April 2013, the conjecture is still unproved.
a(n) = A000040(A221056(n)). - Reinhard Zumkeller, Apr 15 2013

Examples

			5 is a term because there are no squares between the adjacent primes 5 and 7.
		

Crossrefs

Programs

  • Haskell
    a224363 = a000040 . a221056  -- Reinhard Zumkeller, Apr 15 2013
  • Mathematica
    Select[Prime[Range[60]], Floor[Sqrt[NextPrime[#]]] == Floor[Sqrt[#]] &] (* Giovanni Resta, Apr 10 2013 *)

Extensions

Corrected and edited by Giovanni Resta, Apr 10 2013

A000006 Integer part of square root of n-th prime.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Conjecture: No two successive terms in the sequence differ by more than 1. Proof of this would prove the converse of the theorem that every prime is surrounded by two consecutive squares, namely |sqrt(p)|^2 and (|sqrt(p)|+1)^2. - Cino Hilliard, Jan 22 2003
Equals the number of squares less than prime(n). Cf. A014689. - Zak Seidov Nov 04 2007
The above conjecture is Legendre's conjecture that for n > 0 there is always a prime between n^2 and (n+1)^2. See A014085, number of primes between two consecutive squares, which is also the number of times n is repeated in the present sequence. - Jean-Christophe Hervé, Oct 25 2013

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 2.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A014085.
See also A263846 (floor of cube root of prime(n)), A000196 (floor of sqrt(n)), A048766 (floor of cube root of n).

Programs

  • Haskell
    a000006 = a000196 . a000040  -- Reinhard Zumkeller, Mar 24 2012
    
  • Mathematica
    a[n_] := IntegerPart[Sqrt[Prime[n]]]
    IntegerPart[Sqrt[#]]&/@Prime[Range[80]] (* Harvey P. Dale, Mar 06 2012 *)
  • PARI
    (a(n)=sqrtint(prime(n))); vector(100,n,a(n)) \\ Edited by M. F. Hasler, Oct 19 2018
    
  • PARI
    apply(sqrtint,primes(100)) \\ Charles R Greathouse IV, Apr 26 2012
    
  • PARI
    apply( A000006=n->sqrtint(prime(n)), [1..100]) \\ M. F. Hasler, Oct 19 2018
    
  • Python
    from sympy import sieve
    A000006 = lambda n: int(sieve[n]**.5)
    print([A000006(n) for n in range(1,100+1)])
    # Albert Lahat, Jun 25 2020

Formula

a(n) = A000196(A000040(n)). - Reinhard Zumkeller, Mar 24 2012

A050216 Number of primes between (prime(n))^2 and (prime(n+1))^2, with a(0) = 2 by convention.

Original entry on oeis.org

2, 2, 5, 6, 15, 9, 22, 11, 27, 47, 16, 57, 44, 20, 46, 80, 78, 32, 90, 66, 30, 106, 75, 114, 163, 89, 42, 87, 42, 100, 354, 99, 165, 49, 299, 58, 182, 186, 128, 198, 195, 76, 356, 77, 144, 75, 463, 479, 168, 82, 166, 270, 90, 438, 275, 274, 292, 91, 292, 199, 99
Offset: 0

Views

Author

Keywords

Comments

The function in Brocard's Conjecture, which states that for n >= 2, a(n) >= 4.
The lines in the graph correspond to prime gaps of 2, 4, 6, ... . - T. D. Noe, Feb 04 2008
Lengths of blocks of consecutive primes in A000430 (union of primes and squares of primes). - Reinhard Zumkeller, Sep 23 2011
In the n-th step of the sieve of Eratosthenes, all multiples of prime(n) are removed. Then a(n) gives the number of new primes obtained after the n-th step. - Jean-Christophe Hervé, Oct 27 2013
More precisely, after the n-th step, one is sure to have eliminated all composites less than prime(n+1)^2, since any composite N has a prime factor <= sqrt(N). It is in exactly this (restricted) sense that a(n) yields the number of "new primes" (additional numbers known to be prime) after the n-th step. But one knows after the n-th step also that all remaining numbers between prime(n+1)^2 and prime(n+1)*(prime(n+1)+2) are prime: By construction they don't have a factor less than prime(n+1) and they don't have a factor prime(n+1) so the least prime factor could be prime(n+2) >= prime(n+1)+2. For example, after eliminating multiples of 3 in the 2nd step, one has (2, 3, 5, 7, 11, 13, 17, 23, 25, 29, 31, 35, ...) and one knows that all remaining numbers strictly in between 5^2=25 and 5*(5+2)=35 are prime, too. - M. F. Hasler, Dec 31 2014
Numerically, the slope of the lowest "ray" m(n) = min {a(k); k>n}, seems to converge to a value somewhere in the range 1.75 < m(n)/n < 1.8; with m(n)/n > 1.7 for n > 900, m(n)/n > 1.75 for n > 2700. - M. F. Hasler, Dec 31 2014
Legendre's conjecture (see A014085) would imply that a(n) >= 2 for all n and that sequences A054272, A250473 and A250474 were thus strictly increasing (see the Wikipedia article about Brocard's conjecture). - Antti Karttunen, Jan 01 2015
a(n) >= 4 up to at least n = 4*10^5. - Eric W. Weisstein, Jan 13 2025

Examples

			There are 2 primes less than 2^2, there are 2 primes between 2^2 and 3^2, 5 primes between 3^2 and 5^2, etc. [corrected by Jonathan Sperry, Aug 30 2013]
		

References

  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 183.

Crossrefs

First differences of A000879.
One more than A251723.
Cf. A380135 (High water marks for number of primes between prime(n)^2 and prime(n+1)^2).
Cf. A380136 (Positions of the high water marks for number of primes between prime(n)^2 and prime(n+1)^2).

Programs

  • Haskell
    import Data.List (group)
    a050216 n = a050216_list !! (n-1)
    a050216_list =
       map length $ filter (/= [0]) $ group $ map a010051 a000430_list
    -- Reinhard Zumkeller, Sep 23 2011
    
  • Maple
    A050216 := proc(n)
        local p,pn ;
        if n = 0 then
            2;
        else
            p := ithprime(n) ;
            pn := nextprime(p) ;
            numtheory[pi](pn^2)-numtheory[pi](p^2) ;
        end if;
    end proc:
    seq(A050216(n),n=0..40) ; # R. J. Mathar, Jan 27 2025
  • Mathematica
    -Subtract @@@ Partition[PrimePi[Prime[Range[20]]^2], 2, 1] (* Eric W. Weisstein, Jan 10 2025 *)
  • PARI
    a(n)={n||return(2);primepi(prime(n+1)^2)-primepi(prime(n)^2)} \\ M. F. Hasler, Dec 31 2014

Formula

For all n >= 1, a(n) = A256468(n) + A256469(n). - Antti Karttunen, Mar 30 2015
Limit_{N->oo} (Sum_{n=1..N} a(n)) / (Sum_{n=1..N} prime(n)) = 1. - Alain Rocchelli, Sep 30 2023

Extensions

Edited by N. J. A. Sloane, Nov 15 2009

A053000 a(n) = (smallest prime > n^2) - n^2.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 21 2000

Keywords

Comments

Suggested by Legendre's conjecture (still open) that there is always a prime between n^2 and (n+1)^2.
Record values are listed in A070317, their indices in A070316. - M. F. Hasler, Mar 23 2013
Conjecture: a(n) <= 1+phi(n) = 1+A000010(n), for n>0. This improves on Oppermann's conjecture, which says a(n) < n. - Jianglin Luo, Sep 22 2023

References

  • J. R. Goldman, The Queen of Mathematics, 1998, p. 82.
  • R. K. Guy, Unsolved Problems in Number Theory, Section A1.

Crossrefs

Programs

  • Magma
    [NextPrime(n^2) - n^2: n in [0..100]]; // Vincenzo Librandi, Jul 06 2015
    
  • Maple
    A053000 := n->nextprime(n^2)-n^2;
  • Mathematica
    nxt[n_]:=Module[{n2=n^2},NextPrime[n2]-n2]
    nxt/@Range[0,100]  (* Harvey P. Dale, Dec 20 2010 *)
  • PARI
    A053000(n)=nextprime(n^2)-n^2  \\ M. F. Hasler, Mar 23 2013
    
  • Python
    from sympy import nextprime
    def a(n): nn = n*n; return nextprime(nn) - nn
    print([a(n) for n in range(94)]) # Michael S. Branicky, Feb 17 2022

Formula

a(n) = A013632(n^2). - Robert Israel, Jul 06 2015

Extensions

More terms from James Sellers, Feb 22 2000

A056892 a(n) = square excess of the n-th prime.

Original entry on oeis.org

1, 2, 1, 3, 2, 4, 1, 3, 7, 4, 6, 1, 5, 7, 11, 4, 10, 12, 3, 7, 9, 15, 2, 8, 16, 1, 3, 7, 9, 13, 6, 10, 16, 18, 5, 7, 13, 19, 23, 4, 10, 12, 22, 24, 1, 3, 15, 27, 2, 4, 8, 14, 16, 26, 1, 7, 13, 15, 21, 25, 27, 4, 18, 22, 24, 28, 7, 13, 23, 25, 29, 35, 6, 12, 18, 22, 28, 36, 1, 9, 19, 21
Offset: 1

Views

Author

Henry Bottomley, Jul 05 2000

Keywords

Examples

			a(5) = 2 since the 5th prime is 11 = 3^2 + 2.
From _M. F. Hasler_, Oct 19 2018: (Start)
Written as a table, starting a new row when a square is reached, the sequence reads:
  1, 2,    // = 2 - 1, 3 - 1 = {primes between 1^2 = 1 and 2^2 = 4} - 1
  1, 3,     // = 5 - 4, 7 - 4 = {primes between 2^2 = 4 and 3^2 = 9} - 4
  2, 4,      // = 11 - 9, 13 - 9 = {primes between 3^2 = 9 and 4^2 = 16} - 9
  1, 3, 7,    // = 17 - 16, 19 - 16, 23 - 16 = {primes between 16 and 25} - 16
  4, 6,        // = 29 - 25, 31 - 25 = {primes between 5^2 = 25 and 6^2 = 36} - 25
  1, 5, 7, 11,  // = {37, 41, 43, 47: primes between 6^2 = 36 and 7^2 = 49} - 36
  4, 10, 12,    // = {53, 59, 61: primes between 7^2 = 49 and 8^2 = 64} - 49
  3, 7, 9, 15,  // = {67, 71, 73, 79: primes between 8^2 = 64 and 9^2 = 81} - 64
  2, 8, 16,     // = {83, 89, 97: primes between 9^2 = 81 and 10^2 = 100} - 81
  etc. (End)
		

Crossrefs

When written as a table, row lengths are A014085, and row sums are A108314 - A014085 * A000290 = A320688.

Programs

Formula

a(n) = A053186(A000040(n)).
a(n) = A000040(n) - A000006(n)^2. - M. F. Hasler, Oct 04 2009

A060199 Number of primes between n^3 and (n+1)^3.

Original entry on oeis.org

0, 4, 5, 9, 12, 17, 21, 29, 32, 39, 49, 52, 58, 73, 76, 88, 92, 109, 117, 125, 140, 151, 159, 176, 188, 199, 207, 233, 247, 254, 267, 284, 305, 320, 346, 338, 373, 385, 416, 418, 437, 458, 481, 504, 517, 551, 555, 583, 599, 636, 648, 678, 686, 733, 723, 753, 810
Offset: 0

Views

Author

Labos Elemer, Mar 19 2001

Keywords

Comments

Ingham showed that for n large enough and k=5/8, prime(n+1)-prime(n) = O(prime(n)^k). Ingham's result implies that there is a prime between sufficiently large consecutive cubes. Therefore a(n) is nonzero for n sufficiently large. Using the Riemann Hypothesis, Caldwell and Cheng prove there is a prime between all consecutive cubes. The question is undecided for squares. Many authors have reduced the value of k. The best value of k is 21/40, proved by Baker, Harman and Pintz in 2001. - corrected by Jonathan Sondow, May 19 2013
Conjecture: There are always more than 3 primes between two consecutive nonzero cubes. - Cino Hilliard, Jan 05 2003
Dudek (2014), correcting a claim of Cheng, shows that a(n) > 0 for n > exp(exp(33.217)) = 3.06144... * 10^115809481360808. - Charles R Greathouse IV, Jun 27 2014
Cully-Hugill shows the above for n > exp(exp(32.892)) = 6.92619... * 10^83675518094285. - Charles R Greathouse IV, Aug 02 2021
Mossinghoff, Trudgian, & Yang improve this to n > exp(exp(32.76)) = 3.62275 * 10^73328286790528. - Charles R Greathouse IV, Jul 31 2024

Examples

			n = 2: there are 5 primes between 8 and 27, 11,13,17,19,23.
n = 9, n+1 = 10: PrimePi(1000)-PrimePi(729) = 168-129 = a(9) = 39.
		

Crossrefs

First differences of A038098.

Programs

  • Magma
    [0] cat [#PrimesInInterval(n^3, (n+1)^3): n in [1..70]]; // Vincenzo Librandi, Feb 13 2016
    
  • Mathematica
    PrimePi[(#+1)^3]-PrimePi[#^3]&/@Range[0,60] (* Harvey P. Dale, Feb 08 2013 *)
    Last[#]-First[#]&/@Partition[PrimePi[Range[0,60]^3],2,1] (* Harvey P. Dale, Feb 02 2015 *)
  • PARI
    cubespr(n)= for(x=0,n, ct=0; for(y=x^3,(x+1)^3, if(isprime(y), ct++; )); if(ct>=0,print1(ct, ", ")))  \\ Cino Hilliard, Jan 05 2003
    
  • Python
    from sympy import primepi
    def a(n): return primepi((n+1)**3) - primepi(n**3)
    print([a(n) for n in range(57)]) # Michael S. Branicky, Jun 22 2021

Formula

Table[PrimePi[(j+1)^3]-PrimePi[j^3], {j, 1, 100}]

Extensions

Corrected and added more detail to the Ingham references. - T. D. Noe, Sep 23 2008
Combined two comments, correcting a bad error in the first comment. - T. D. Noe, Sep 27 2008
Edited by N. J. A. Sloane, Jan 17 2009 at the suggestion of R. J. Mathar

A066888 Number of primes p between triangular numbers T(n) < p <= T(n+1).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jun 06 2003

Keywords

Comments

It is conjectured that for n > 0, a(n) > 0. See also A190661. - John W. Nicholson, May 18 2011
If the above conjecture is true, then for any k > 1 there is a prime p > k such that p <= (n+1)(n+2)/2, where n = floor(sqrt(2k)+1/2). Ignoring the floor function we can obtain a looser (but nicer) lower bound of p <= 1 + k + 2*sqrt(2k). - Dmitry Kamenetsky, Nov 26 2016

Examples

			Write the numbers 1, 2, ... in a triangle with n terms in the n-th row; a(n) = number of primes in n-th row.
Triangle begins
   1              (0 primes)
   2  3           (2 primes)
   4  5  6        (1 prime)
   7  8  9 10     (1 prime)
  11 12 13 14 15  (2 primes)
		

Crossrefs

Cf. A083382.
Essentially the same as A065382 and A090970.

Programs

  • Mathematica
    Table[PrimePi[(n^2 + n)/2] - PrimePi[(n^2 - n)/2], {n, 96}] (* Alonso del Arte, Sep 03 2011 *)
    PrimePi[#[[2]]]-PrimePi[#[[1]]]&/@Partition[Accumulate[Range[0,100]],2,1] (* Harvey P. Dale, Jun 04 2019 *)
  • PARI
    { tp(m)=local(r, t); r=1; for(n=1,m,t=0; for(k=r,n+r-1,if(isprime(k),t++)); print1(t","); r=n+r; ) }
    
  • PARI
    {tpf(m)=local(r, t); r=1; for(n=1,m,t=0; for(k=r,n+r-1,if(isprime(k),t++); print1(k" ")); print1(" ("t" prime)"); print(); r=n+r;) }
    
  • Python
    from sympy import primerange
    def A066888(n): return sum(1 for p in primerange((n*(n+1)>>1)+1,((n+2)*(n+1)>>1)+1)) # Chai Wah Wu, May 22 2025

Formula

a(n) = pi(n*(n+1)/2) - pi(n*(n-1)/2).
a(n) equals the number of occurrences of n+1 in A057062. - Esko Ranta, Jul 29 2011

Extensions

More terms from Vladeta Jovovic and Jason Earls, Jun 06 2003
Offset corrected by Daniel Forgues, Sep 05 2012

A083382 Write the numbers from 1 to n^2 consecutively in n rows of length n; a(n) = minimal number of primes in a row.

Original entry on oeis.org

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

Views

Author

James Propp, Jun 05 2003

Keywords

Comments

Conjectured by Schinzel (Hypothesis H2) to be always positive for n > 1.
The conjecture has been verified for n = prime < 790000 by Aguilar.
If this is true, then Legendre's conjecture is true as well. (See A014085). - Antti Karttunen, Jan 01 2019

Examples

			For n = 3 the array is
1 2 3 (2 primes)
4 5 6 (1 prime)
7 8 9 (1 prime)
so a(3) = 1
		

References

  • P. Ribenboim, The New Book of Prime Number Records, Chapter 6.
  • P. Ribenboim, The Little Book Of Big Primes, Springer-Verlag, NY 1991, page 185.

Crossrefs

A084927 generalizes this to three dimensions.
Cf. A083415, A083383, A066888, A092556, A092557. See A083414 for primes in columns.
Cf. A139326.

Programs

  • Haskell
    a083382 n = f n n a010051_list where
       f m 0 _     = m
       f m k chips = f (min m $ sum chin) (k - 1) chips' where
         (chin,chips') = splitAt n chips
    -- Reinhard Zumkeller, Jun 10 2012
    
  • Maple
    A083382 := proc(n) local t1,t2,at; t1 := n; at := 0; for i from 1 to n do t2 := 0; for j from 1 to n do at := at+1; if isprime(at) then t2 := t2+1; fi; od; if t2 < t1 then t1 := t2; fi; od; t1; end;
  • Mathematica
    Table[minP=n; Do[s=0; Do[If[PrimeQ[c+(r-1)*n], s++ ], {c, n}]; minP=Min[s, minP], {r, n}]; minP, {n, 100}]
    Table[Min[Count[#,?PrimeQ]&/@Partition[Range[n^2],n]],{n,110}] (* _Harvey P. Dale, May 29 2013 *)
  • PARI
    A083382(n) = { my(m=-1); for(i=0,n-1,my(s=sum(j=(i*n),((i+1)*n)-1,isprime(1+j))); if((m<0) || (s < m), m = s)); (m); }; \\ Antti Karttunen, Jan 01 2019

Extensions

Edited by Charles R Greathouse IV, Jul 07 2010

A106044 Difference between n-th prime and next larger perfect square.

Original entry on oeis.org

2, 1, 4, 2, 5, 3, 8, 6, 2, 7, 5, 12, 8, 6, 2, 11, 5, 3, 14, 10, 8, 2, 17, 11, 3, 20, 18, 14, 12, 8, 17, 13, 7, 5, 20, 18, 12, 6, 2, 23, 17, 15, 5, 3, 28, 26, 14, 2, 29, 27, 23, 17, 15, 5, 32, 26, 20, 18, 12, 8, 6, 31, 17, 13, 11, 7, 30, 24, 14, 12, 8, 2, 33, 27, 21, 17, 11, 3, 40, 32, 22
Offset: 1

Views

Author

Zak Seidov, May 06 2005

Keywords

Comments

Can be read as a table, since there are always several primes between two squares, although this is the yet unproved Legendre's conjecture, cf. A014085. Whenever a(n+1) > a(n), the n-th prime is the largest one below a given square and prime(n+1) is the smallest prime larger than that square. For n > 1, these are also the indices where the parity of the terms changes. - M. F. Hasler, Oct 19 2018

Examples

			From _M. F. Hasler_, Oct 19 2018: (Start)
Written as a table, starting a new row when a square is reached, the sequence reads:
  2, 1,  // 4 - {2, 3: primes between 1^2 = 1 and 2^2 = 4}
  4, 2,   // 9 - {5, 7: primes between 2^2 = 4 and 3^2 = 9}
  5, 3,    // 16 - {11, 13: primes between 3^2 = 9 and 4^2 = 16}
  8, 6, 2,  // 25 - {17, 19, 23: primes between 4^2 = 16 and 5^2 = 25}
  7, 5,      // 36 - {29, 31: primes between 5^2 = 25 and 6^2 = 36}
  12, 8, 6, 2,// 49 - {37, 41, 43, 47: primes between 6^2 = 36 and 7^2 = 49}
  11, 5, 3,    // 64 - {53, 59, 61: primes between 7^2 = 49 and 8^2 = 64}
  14, 10, 8, 2, // 81 - {67, 71, 73, 79: primes between 8^2 = 64 and 9^2 = 81}
  17, 11, 3,     // 100 - {83, 89, 97: primes between 9^2 = 81 and 10^2 = 100}
  etc. (End)
		

Crossrefs

Cf. A158038 (analog for cubes).
Read as a table, row lengths are A014085 (number of primes between squares).
Row sums are A014085 * A000290(.+1) - A108314.

Programs

Extensions

Edited by M. F. Hasler, Oct 19 2018

A143227 (Number of primes between n and 2n) - (number of primes between n^2 and (n+1)^2), if > 0.

Original entry on oeis.org

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

Views

Author

Jonathan Sondow, Aug 02 2008

Keywords

Comments

If the sequence is bounded (e.g., if it is finite), then Legendre's conjecture is true: there is always a prime between n^2 and (n+1)^2, at least for all sufficiently large n. This follows from the strong form of Bertrand's postulate proved by Ramanujan (see A104272 Ramanujan primes).

Examples

			The first positive value of ((pi(2n) - pi(n)) - (pi((n+1)^2) - pi(n^2))) is 1 (at n = 42), the 2nd is 2 (at n = 55) and the 3rd is 1 (at n = 56), so a(1) = 1, a(2) = 2, a(3) = 1.
		

References

  • M. Aigner and C. M. Ziegler, Proofs from The Book, Chapter 2, Springer, NY, 2001.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1989, p. 19.
  • S. Ramanujan, Collected Papers of Srinivasa Ramanujan (G. H. Hardy, S. Aiyar, P. Venkatesvara and B. M. Wilson, eds.), Amer. Math. Soc., Providence, 2000, pp. 208-209.

Crossrefs

Cf. A000720, A014085, A060715, A104272, A143223, A143224, A143225, A143226 = corresponding values of n.

Programs

  • Mathematica
    L={}; Do[ With[ {d=(PrimePi[2n]-PrimePi[n])-(PrimePi[(n+1)^2]-PrimePi[n^2])}, If[d>0, L=Append[L,d]]], {n,0,1000}]; L
    Select[Table[(PrimePi[2n]-PrimePi[n])-(PrimePi[(n+1)^2]-PrimePi[n^2]),{n,1000}],#>0&] (* Harvey P. Dale, Jun 19 2019 *)

Formula

a(n) = |A143223(A143226(n))|.
Previous Showing 11-20 of 114 results. Next