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-7 of 7 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

A054272 Number of primes in the interval [prime(n), prime(n)^2].

Original entry on oeis.org

2, 3, 7, 12, 26, 34, 55, 65, 91, 137, 152, 208, 251, 270, 315, 394, 471, 502, 591, 656, 685, 790, 864, 977, 1139, 1227, 1268, 1354, 1395, 1494, 1847, 1945, 2109, 2157, 2455, 2512, 2693, 2878, 3005, 3202, 3396, 3471, 3826, 3902, 4045, 4119, 4581, 5059
Offset: 1

Views

Author

Labos Elemer, May 05 2000

Keywords

Comments

These primes are candidates for fortunate numbers (A005235).
These are precisely the primes available for the solution of Aguilar's conjecture or Haga's conjecture in Carlos Rivera's The Prime Puzzles and Problems Connection, (conjecture 26). Aguilar's conjecture states that at least one prime will be available for placement on each row and column of a p X p square array. Haga's conjecture states that just p primes are required for such placement in any p X p array. - Enoch Haga, Jan 23 2002
Also number of times p_n (the n-th prime) occurs as the least prime factor (A020639) among numbers in range [(p_n)+1, ((p_n)^3)-1]. For n=1, p_1 = 2 and there are two even numbers in range [3, 7], namely 4 and 6, so a(1) = 2. See also A250474. - Antti Karttunen, Dec 05 2014
The number of consecutive primes after the leading 1 in the prime(n)-rough numbers. - Benedict W. J. Irwin, Mar 24 2016

Examples

			n=4, the zone in question is [7,49] and encloses a(4)=12 primes, as follows: {7,11,13,17,19,23,29,31,37,41,43,47}.
		

Crossrefs

One less than A250473, two less than A250474.
First differences: A251723.

Programs

  • Mathematica
    a[n_] := PrimePi[Prime[n]^2] - n + 1; Array[a, 50] (* Jean-François Alcover, Dec 07 2015 *)
  • PARI
    \\ A fast version:
    default(primelimit, 2^31 + 2^30);
    A054272(n) = 1 + primepi(prime(n)^2) - n;
    for(n=1, 5000, write("b054272.txt", n, " ", A054272(n)));
    \\ The following mirrors the given new formula. It is far from an optimal way to compute this sequence:
    allocatemem(234567890);
    A002110(n) = prod(i=1, n, prime(i));
    A054272(n) = { my(p2); p2 = prime(n)^2; sumdiv(A002110(n), d, moebius(d)*floor(p2/d)); };
    for(n=1, 22, print1(A054272(n),", ")); \\ Antti Karttunen, Dec 05 2014

Formula

a(n) = A000879(n) - n + 1.
From Antti Karttunen, Dec 05-08 2014: (Start)
a(n) = A250473(n) - 1 = A250474(n) - 2.
a(n) = sum_{d | A002110(n)} moebius(d) * floor((p_n)^2 / d). [Where p_n is the n-th prime (A000040(n)) and A002110(n) gives the product of the first n primes. Because the latter is always squarefree, one could also use Liouville's lambda (A008836) instead of Moebius mu (A008683).]
The ratio (a(n) * A002110(n)) / (A001248(n) * A005867(n)) stays near 1, which follows from the above summation formula. See also A249747.
(End)

A251719 a(n) = the least k such that A250474(k) > n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 15 2014

Keywords

Comments

Provided that A250474 is strictly increasing (implied for example if either Legendre's or Brocard's conjecture is true) then all natural numbers occur in this sequence, in order, and after three 1's, each n+1 appears for the first time at A250474(n). Thus from n=2 onward, each n occurs A251723(n-1) times.
With the same provision, we have for n>1: a(n) = smallest positive integer k such that A083221(k, n) is a semiprime and A083221(k+1, n) = A003961(A083221(k, n)), where A003961 shifts the prime factorization one step towards larger primes, thus the latter value is also a semiprime.

Crossrefs

Formula

Equally: a(1) = a(2) = a(3) = 1; and for n>=4: a(n) = the largest k such that A250474(k-1) <= n.
Other identities. For all n >= 1:
a(n) >= A251718(n) >= A251717(n).
a(n) = A055396(A251724(n)), or equally, A251724(n) = A083221(a(n), n). [This sequence gives the row-index of the first "settled semiprime" in column n of the sieve of Eratosthenes.]

A256447 Number of integers in range (prime(n)^2)+1 .. (prime(n)*prime(n+1)) whose smallest prime factor is at least prime(n): a(n) = A250477(n) - A250474(n).

Original entry on oeis.org

2, 3, 3, 7, 5, 9, 6, 13, 23, 9, 28, 22, 12, 24, 39, 37, 17, 44, 32, 16, 53, 37, 53, 76, 46, 23, 43, 20, 49, 161, 48, 82, 23, 142, 27, 91, 90, 66, 103, 97, 41, 181, 41, 74, 39, 228, 228, 86, 45, 86, 130, 44, 217, 134, 141, 138, 46, 148, 106, 47, 261, 355, 116, 53, 109, 387, 166, 284, 65, 119, 181, 243, 198, 195, 122, 190, 268, 125, 265, 330, 78
Offset: 1

Views

Author

Antti Karttunen, Mar 29 2015

Keywords

Comments

a(n) = number of integers in range [(prime(n)^2)+1, (prime(n) * prime(n+1))] whose smallest prime factor is at least prime(n).
All the terms are strictly positive, because at least for the last number in the range we have A020639(prime(n)*prime(n+1)) = prime(n).
See the conjectures in A256448.

Examples

			For n=1, we have in range [(prime(1)^2)+1, (prime(1) * prime(2))], that is, in range [5,6], two numbers, 5 and 6, whose smallest prime factor (A020639) is at least 2, thus a(1) = 2.
For n=2, we have in range [10, 15] three numbers, {11, 13, 15}, whose smallest prime factor is at least 3, thus a(2) = 3.
For n=3, we have in range [26, 35] three numbers, {29, 31, 35}, whose smallest prime factor is at least prime(3) = 5, thus a(3) = 3.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Count[Range[Prime[n]^2 + 1, Prime[n] Prime[n + 1]],
      x_ /; Min[First /@ FactorInteger[x]] >=
    Prime@n]; Array[f, 81] (* Michael De Vlieger, Mar 30 2015 *)
  • Scheme
    (define (A256447 n) (- (A250477 n) (A250474 n)))

Formula

a(n) = A250477(n) - A250474(n).
a(n) = A251723(n) - A256448(n).
a(n) = A256448(n) + A256449(n).
a(n) = A256468(n) + 1.
Other identities. For all n >= 1:
a(n+1) = A256446(n) - A256448(n).

A256448 a(n) = A250474(n+1) - A250477(n).

Original entry on oeis.org

-1, 1, 2, 7, 3, 12, 4, 13, 23, 6, 28, 21, 7, 21, 40, 40, 14, 45, 33, 13, 52, 37, 60, 86, 42, 18, 43, 21, 50, 192, 50, 82, 25, 156, 30, 90, 95, 61, 94, 97, 34, 174, 35, 69, 35, 234, 250, 81, 36, 79, 139, 45, 220, 140, 132, 153, 44, 143, 92, 51, 250, 379, 103, 53, 105, 396, 174, 294, 59, 121, 181, 245, 182, 184, 129, 203, 261, 136, 265, 339, 72
Offset: 1

Views

Author

Antti Karttunen, Mar 29 2015

Keywords

Comments

a(n) tells how many more positive integers there are <= prime(n+1)^2 whose smallest prime factor is at least prime(n+1), as compared to how many positive integers there are <= (prime(n) * prime(n+1)) whose smallest prime factor is at least prime(n).
Conjecture 1: for n >= 2, a(n) > 0.
Conjecture 2: ratio a(n)/A256447 converges towards 1. See the associated plots in A256447 and A256449 and comments in A050216.
As what comes to the second conjecture, it's not necessarily true. See the plots linked into A256468. - Antti Karttunen, Mar 30 2015

Examples

			For n=1, the respective primes are prime(1) = 2 and prime(2) = 3, and the ranges in question are [1, 9] and [1, 6]. The former range contains 4 such numbers whose lpf (A020639) is at least 3, namely {3, 5, 7, 9}, while the latter range contains 5 such numbers whose lpf is at least 2, namely {2, 3, 4, 5, 6}, thus a(1) = 4 - 5 = -1.
For n=2, the respective primes are prime(2) = 3 and prime(3) = 5, and the ranges in question are [1, 25] and [1, 15]. The former range contains 8 such numbers whose lpf is at least 5, namely {5, 7, 11, 13, 17, 19, 23, 25}, while the latter range contains 7 such numbers whose lpf is at least 3, namely {3, 5, 7, 9, 11, 13, 15}, thus a(2) = 8 - 7 = 1.
For n=3, the respective primes are prime(3) = 5 and prime(4) = 7, and the ranges in question are [1, 49] and [1, 35]. The former range contains 13 such numbers whose lpf is at least 7, namely {7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 49}, while the latter range contains 11 such numbers whose lpf is at least 5, namely {5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35}, thus a(3) = 13 - 11 = 2.
		

Crossrefs

Programs

Formula

a(n) = A256469(n) - 2.
a(n) = A250474(n+1) - A250477(n).
a(n) = A251723(n) - A256447(n).
a(n) = A256446(n) - A256447(n+1).
a(n) = A256447(n) - A256449(n).

A256446 First differences of A250477: a(n) = A250477(n+1) - A250477(n).

Original entry on oeis.org

2, 4, 9, 12, 12, 18, 17, 36, 32, 34, 50, 33, 31, 60, 77, 57, 58, 77, 49, 66, 89, 90, 136, 132, 65, 61, 63, 70, 211, 240, 132, 105, 167, 183, 121, 180, 161, 164, 191, 138, 215, 215, 109, 108, 263, 462, 336, 126, 122, 209, 183, 262, 354, 281, 270, 199, 192, 249, 139, 312, 605, 495, 156, 162, 492, 562, 458, 359, 178, 302, 424, 443, 377, 306
Offset: 1

Views

Author

Antti Karttunen, Mar 29 2015

Keywords

Crossrefs

Programs

Formula

a(n) = A250477(n+1) - A250477(n).
a(n) = A256447(n+1) + A256448(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).
Showing 1-7 of 7 results.