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

A342068 a(n) is the smallest k > 1 such that there are more primes in the interval [(k-1)*n + 1, k*n] than there are in the interval [(k-2)*n + 1, (k-1)*n].

Original entry on oeis.org

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

Views

Author

Jon E. Schoenfield, Mar 21 2021

Keywords

Comments

a(519) is a noteworthy record high value; a(n) < 13 for all n < 519, and a(n) < 19 for all n < 9363 except that a(519)=19.

Examples

			The 1st 100 positive integers,   1..100, include 25 primes;
the 2nd 100 positive integers, 101..200, include 21 primes;
the 3rd 100 positive integers, 201..300, include 16 primes;
the 4th 100 positive integers, 301..400, include 16 primes;
the 5th 100 positive integers, 401..500, include 17 primes.
The sequence 25, 21, 16, 16, 17, is nonincreasing until we reach the 5th term, 17, so a(100) = 5.
Considering the positive integers in consecutive intervals of length 519, instead (i.e., [1,519], [2,1038], [3,1557], ...) and counting the primes in each interval, we get a sequence that is nonincreasing until we reach the 19th term, since the 19th interval, [9343,9861], contains more primes than does the 18th, so a(519)=19.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) uses numtheory; local i, j, k; i:= n;
          for k do j:= pi(k*n)-pi((k-1)*n);
            if j>i then break else i:=j fi
          od; k
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 21 2021
  • Mathematica
    a[n_] := Module[{i = n, j, k},
         For[k = 1, True, k++, j = PrimePi[k*n] - PrimePi[(k-1)*n];
         If[j > i, Break[], i = j]]; k];
    Array[a, 100] (* Jean-François Alcover, Jul 01 2021, after Alois P. Heinz *)
  • Python
    from sympy import primepi
    def A342068(n):
        k, a, b, c = 2,0,primepi(n),primepi(2*n)
        while a+c <= 2*b:
            k += 1
            a, b, c = b, c, primepi(k*n)
        return k # Chai Wah Wu, Mar 25 2021

A342069 a(n) is the smallest k such that A342068(k) = n.

Original entry on oeis.org

1, 5, 12, 4, 2, 6, 31, 28, 3, 13, 169, 729, 3128, 2245, 4660, 2524, 5198, 519, 40016, 48916, 12350, 45362, 69266, 74080, 122062, 117172, 86999, 206214, 86845, 144921, 328452, 213238, 309939, 387079, 652124, 504874, 694074, 596997, 763820, 741672, 404949
Offset: 2

Views

Author

Jon E. Schoenfield, Mar 23 2021

Keywords

Comments

For n > 42, a(n) > 763820 = a(42).
a(19)=519 corresponds to the noteworthy record high value (19) in A342068 that occurs at n=519.

Examples

			5 is the smallest k such that A342068(k)=3, so a(3)=5.
		

Crossrefs

A342071 Numbers k such that there are more primes in the interval [3*k+1, 4*k] than there are in the interval [2*k+1, 3*k].

Original entry on oeis.org

12, 19, 22, 32, 42, 45, 49, 50, 52, 54, 57, 59, 70, 71, 72, 73, 74, 75, 101, 102, 115, 116, 117, 121, 122, 123, 124, 126, 132, 143, 180, 182, 184, 185, 186, 187, 188, 189, 190, 192, 194, 195, 197, 268, 269, 309, 310, 311, 312, 322, 323, 325, 326, 327, 328, 329
Offset: 1

Views

Author

Jon E. Schoenfield, Mar 23 2021

Keywords

Comments

After a(194)=3977, there are no more terms < 100000.
Conjecture: a(194)=3977 is the final term.
For each of the first 194 terms k, there are at least as many primes in [1, k] as there are in [k+1, 2*k], and at least as many primes in [k+1, 2*k] as there are in [2*k+1, 3*k], so A342068(k)=4.

Examples

			The intervals [1, 100], [101, 200], [201, 300], and [301, 400] contain 25, 21, 16, and 16 primes respectively (cf. A038822); the 4th interval does not contain more primes than does the 3rd, so 100 is not a term of the sequence.
However, the intervals [1, 101], [102, 202], [203, 303], and [304, 404] contain 26, 20, 16, and 17 primes, respectively; 17 > 16, so 101 is a term.
		

Crossrefs

A342839 Numbers k such that there are more primes in the interval [4*k+1, 5*k] than there are in the interval [3*k+1, 4*k].

Original entry on oeis.org

1, 4, 7, 9, 10, 15, 16, 22, 23, 24, 25, 34, 36, 37, 39, 40, 47, 55, 56, 57, 58, 64, 67, 82, 84, 86, 87, 88, 91, 93, 94, 95, 96, 97, 98, 99, 100, 102, 104, 105, 106, 107, 130, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 144, 146, 147, 148, 149, 150, 153
Offset: 1

Views

Author

Jon E. Schoenfield, Mar 23 2021

Keywords

Comments

After a(876) = 11895, there are no more terms < 100000.
Conjecture: a(876) = 11895 is the final term.
There exist eight terms k for which A342068(k) != 5: A342068(k) = 2 for k = 1; A342068(k) = 3 for k = 47, 67, 95, and 1323; and A342068(k)=4 for k = 22, 57, and 102.

Examples

			The intervals [1, 100], [101, 200], [201, 300], [301, 400], and [401, 500] contain 25, 21, 16, 16, and 17 primes, respectively (cf. A038822); 17 > 16, so 100 is a term of the sequence.
		

Crossrefs

Showing 1-4 of 4 results.