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.

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

A256471 Numbers n for which there is an equal number of primes in range [prime(n)^2, prime(n)*prime(n+1)] as there are primes in range [prime(n)*prime(n+1), prime(n+1)^2].

Original entry on oeis.org

1, 10, 14, 17, 20, 90, 110, 152, 176, 185, 193, 230, 344, 377, 391, 392, 404, 441, 442, 542, 1066, 1533, 1550, 1632, 1638, 1639, 1810, 2115, 2210, 2302, 2567, 2768, 2921, 3172, 3518, 3615, 3764, 4357, 4577, 4787, 4853, 5060, 5278, 6329
Offset: 1

Views

Author

Antti Karttunen, Mar 30 2015

Keywords

Crossrefs

Positions of zeros in A256470.
Cf. A256472, A256473 (the corresponding primes).

A256468 Number of primes between prime(n)^2 and prime(n)*prime(n+1).

Original entry on oeis.org

1, 2, 2, 6, 4, 8, 5, 12, 22, 8, 27, 21, 11, 23, 38, 36, 16, 43, 31, 15, 52, 36, 52, 75, 45, 22, 42, 19, 48, 160, 47, 81, 22, 141, 26, 90, 89, 65, 102, 96, 40, 180, 40, 73, 38, 227, 227, 85, 44, 85, 129, 43, 216, 133, 140, 137, 45, 147, 105, 46, 260, 354, 115, 52, 108, 386, 165, 283, 64
Offset: 1

Views

Author

Antti Karttunen, Mar 30 2015

Keywords

Crossrefs

One less than A256447.

Programs

  • Mathematica
    Table[Abs@ Subtract[PrimePi[Prime[n]^2], PrimePi[Prime[n] Prime[n + 1]]], {n, 69}] (* Michael De Vlieger, Mar 30 2015 *)
    PrimePi[Times@@#]-PrimePi[#[[1]]^2]&/@Partition[Prime[Range[70]],2,1] (* Harvey P. Dale, Mar 31 2025 *)
  • PARI
    allocatemem(234567890);
    default(primelimit,4294965247);
    A256468(n) = (primepi(prime(n)*prime(n+1)) - primepi(prime(n)^2));
    for(n=1, 6542, write("b256468.txt", n, " ", A256468(n)));
    
  • Scheme
    (define (A256468 n) (let* ((p (A000040 n)) (p2 (* p p))) (let loop ((s 0) (k (* p (A000040 (+ 1 n))))) (cond ((= k p2) s) (else (loop (+ s (if (prime? k) 1 0)) (- k 1)))))))

Formula

a(n) = A256447(n)-1.
a(n) = A050216(n) - A256469(n).
a(n) = A256469(n) - A256470(n).

A256449 a(n) = A256447(n) - A256448(n).

Original entry on oeis.org

3, 2, 1, 0, 2, -3, 2, 0, 0, 3, 0, 1, 5, 3, -1, -3, 3, -1, -1, 3, 1, 0, -7, -10, 4, 5, 0, -1, -1, -31, -2, 0, -2, -14, -3, 1, -5, 5, 9, 0, 7, 7, 6, 5, 4, -6, -22, 5, 9, 7, -9, -1, -3, -6, 9, -15, 2, 5, 14, -4, 11, -24, 13, 0, 4, -9, -8, -10, 6, -2, 0, -2, 16, 11, -7, -13, 7, -11, 0
Offset: 1

Views

Author

Antti Karttunen, Mar 29 2015

Keywords

Comments

Positions of zeros: 4, 8, 9, 11, 22, 27, 32, 40, 64, 71, 79, 104, 113, 126, 140, 201, 225, 332, 333, 394, 451, ...
Corresponding primes: 7, 19, 23, 31, 79, 103, 131, 173, 311, 353, 401, 569, 617, 701, 809, 1229, 1427, 2237, 2239, 2707, 3187, ...

Crossrefs

Programs

Formula

a(n) = A256447(n) - A256448(n).
a(n) = 2*A250477(n) - A250474(n) - A250474(n+1).
a(n) = 3 - A256470(n).

A256469 Number of primes between prime(n)*prime(n+1) and prime(n+1)^2.

Original entry on oeis.org

1, 3, 4, 9, 5, 14, 6, 15, 25, 8, 30, 23, 9, 23, 42, 42, 16, 47, 35, 15, 54, 39, 62, 88, 44, 20, 45, 23, 52, 194, 52, 84, 27, 158, 32, 92, 97, 63, 96, 99, 36, 176, 37, 71, 37, 236, 252, 83, 38, 81, 141, 47, 222, 142, 134, 155, 46, 145, 94, 53, 252, 381, 105, 55, 107, 398, 176, 296, 61
Offset: 1

Views

Author

Antti Karttunen, Mar 30 2015

Keywords

Examples

			For n=1, there is only one prime in range prime(1)*prime(2) .. prime(2)^2, [6 .. 9], namely 7, thus a(1) = 1.
For n=2, the primes in range prime(2)*prime(3) .. prime(3)^2, [15 .. 25] are {17, 19, 23}, thus a(2) = 3.
		

Crossrefs

Programs

  • Mathematica
    Table[Count[Range[Prime[n] Prime[n + 1], Prime[n + 1]^2], ?PrimeQ], {n, 69}] (* _Michael De Vlieger, Mar 30 2015 *)
    Table[PrimePi[Prime[n+1]^2]-PrimePi[Prime[n]Prime[n+1]],{n,70}] (* Harvey P. Dale, Jul 31 2021 *)
  • PARI
    allocatemem(234567890);
    default(primelimit,4294965247);
    A256469(n) = (primepi(prime(n+1)^2) - primepi(prime(n)*prime(n+1)));
    for(n=1, 6541, write("b256469.txt", n, " ", A256469(n)));
    
  • Scheme
    (define (A256469 n) (let* ((p (A000040 n)) (q (A000040 (+ 1 n))) (q2 (* q q))) (let loop ((s 0) (k (* p q))) (cond ((= k q2) s) (else (loop (+ s (if (prime? k) 1 0)) (+ k 1)))))))

Formula

a(n) = A256448(n)+2.
a(n) = A050216(n) - A256468(n).
a(n) = A256468(n) + A256470(n).

A256474 Numbers n for which there are at least as many primes in the range [prime(n)*prime(n+1), prime(n+1)^2] as in the range [prime(n)^2, prime(n)*prime(n+1)].

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 40, 46, 47, 51, 52, 53, 54, 56, 57, 60, 62, 64, 66, 67, 68, 70, 71, 72, 75, 76, 78, 79, 80, 82, 83, 84, 85, 87, 89, 90, 91, 93, 94, 95, 97, 99, 100
Offset: 1

Views

Author

Antti Karttunen, Mar 30 2015

Keywords

Comments

Positions of nonnegative terms in A256470.

Crossrefs

Complement: A256475.
Union of A256471 and A256476.
Cf. A256484 (corresponding primes).
Cf. A256470.

Programs

A256475 Numbers n for which there are more primes in range [prime(n)^2, prime(n)*prime(n+1)] than in range [prime(n)*prime(n+1), prime(n+1)^2].

Original entry on oeis.org

13, 25, 26, 38, 39, 41, 42, 43, 44, 45, 48, 49, 50, 55, 58, 59, 61, 63, 65, 69, 73, 74, 77, 81, 86, 88, 92, 96, 98, 101, 103, 106, 107, 108, 109, 116, 117, 120, 121, 122, 124, 125, 128, 141, 142, 143, 145, 146, 148, 149, 151, 155, 158, 159, 166, 169, 172, 173, 177, 179, 181, 182, 183, 190, 191, 194, 195, 196, 197, 206
Offset: 1

Views

Author

Antti Karttunen, Mar 30 2015

Keywords

Comments

Positions of negative terms in A256470.
Equally: Numbers n for which there are less primes in range [prime(n)*prime(n+1), prime(n+1)^2] than in range [prime(n)^2, prime(n)*prime(n+1)].

Crossrefs

Complement: A256474.
Setwise difference of A256477 and A256471.
Cf. A256485 (corresponding primes).
Cf. A256470.

Programs

A256476 Numbers n for which there are more primes in range [prime(n)*prime(n+1), prime(n+1)^2] than in range [prime(n)^2, prime(n)*prime(n+1)].

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 16, 18, 19, 21, 22, 23, 24, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 40, 46, 47, 51, 52, 53, 54, 56, 57, 60, 62, 64, 66, 67, 68, 70, 71, 72, 75, 76, 78, 79, 80, 82, 83, 84, 85, 87, 89, 91, 93, 94, 95, 97, 99, 100, 102, 104, 105, 111, 112, 113, 114, 115, 118, 119, 123
Offset: 1

Views

Author

Antti Karttunen, Mar 30 2015

Keywords

Comments

Positions where A256470 is strictly positive.

Crossrefs

Complement: A256477.
Setwise difference of A256474 and A256471.
Cf. A256470.

Programs

A256477 Numbers n for which the number of primes in the range [prime(n)*prime(n+1), prime(n+1)^2] is less than or equal to the number of primes in the range [prime(n)^2, prime(n)*prime(n+1)].

Original entry on oeis.org

1, 10, 13, 14, 17, 20, 25, 26, 38, 39, 41, 42, 43, 44, 45, 48, 49, 50, 55, 58, 59, 61, 63, 65, 69, 73, 74, 77, 81, 86, 88, 90, 92, 96, 98, 101, 103, 106, 107, 108, 109, 110, 116, 117, 120, 121, 122, 124, 125, 128, 141, 142, 143, 145, 146, 148, 149, 151, 152, 155, 158, 159, 166, 169
Offset: 1

Views

Author

Antti Karttunen, Mar 30 2015

Keywords

Comments

Positions where A256470 is zero or negative.

Crossrefs

Complement: A256476.
Union of A256471 and A256475.
Cf. A256470.

Programs

Showing 1-9 of 9 results.