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

A238278 a(n) = |{0 < k < n: the number of primes in the interval ((k-1)*n, k*n] and the number of primes in the interval (k*n, (k+1)*n] are both prime}|.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 22 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 3.
(ii) For any integer n > 3, there is a prime p < n such that the number of primes in the interval ((p-1)*n, p*n) is a prime.
We have verified part (i) for n up to 150000.
See also A238277 and A238281 for related conjectures.

Examples

			a(17) = 1 since the interval (9*17, 10*17] contains exactly 3 primes with 3 prime, and the interval (10*17, 11*17] contains exactly 3 primes with 3 prime.
		

Crossrefs

Programs

  • Mathematica
    d[k_,n_]:=PrimePi[k*n]-PrimePi[(k-1)n]
    a[n_]:=Sum[If[PrimeQ[d[k,n]]&&PrimeQ[d[k+1,n]],1,0],{k,1,n-1}]
    Table[a[n],{n,1,80}]

A238281 a(n) = |{0 < k < n: the two intervals (k*n, (k+1)*n) and ((k+1)*n, (k+2)*n) contain the same number of primes}|.

Original entry on oeis.org

0, 1, 2, 1, 2, 3, 3, 1, 5, 2, 4, 4, 8, 3, 7, 4, 4, 4, 2, 3, 7, 3, 10, 4, 12, 7, 7, 15, 7, 9, 8, 5, 8, 9, 11, 8, 8, 10, 8, 4, 10, 10, 10, 11, 7, 10, 8, 11, 8, 8, 9, 9, 8, 11, 7, 8, 13, 10, 8, 14, 13, 4, 14, 8, 11, 12, 14, 12, 8, 10, 16, 12, 16, 12, 14, 19, 11, 14, 8, 9
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 22 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 1. Moreover, if n > 1 is not equal to 8, then there is a positive integer k < n with 2*k + 1 prime such that the two intervals ((k-1)*n, k*n) and (k*n, (k+1)*n) contain the same number of primes.
(ii) For any integer n > 4, there is a positive integer k < prime(n) such that all the three intervals (k*n, (k+1)*n), ((k+1)*n, (k+2)*n), ((k+2)*n, (k+3)*n) contain the same number of primes, i.e., pi(k*n), pi((k+1)*n), pi((k+2)*n), pi((k+3)*n) form a 4-term arithmetic progression.

Examples

			a(8) = 1 since each of the two intervals (7*8, 8*8) and (8*8, 9*8) contains exactly two primes.
		

Crossrefs

Programs

  • Mathematica
    d[k_,n_]:=PrimePi[(k+1)*n]-PrimePi[k*n]
    a[n_]:=Sum[If[d[k,n]==d[k+1,n],1,0],{k,1,n-1}]
    Table[a[n],{n,1,80}]

A238289 Least positive integer k such that prime(k*n), prime((k+1)*n) and prime((k+2)*n) form an arithmetic progression, or 0 if such a number k does not exist.

Original entry on oeis.org

2, 2, 17, 4, 1, 1, 59, 3, 56, 1, 39, 10, 9, 130, 2, 18, 11, 7, 80, 67, 2, 19, 27, 17, 92, 73, 180, 65, 5, 110, 282, 4, 6, 8, 16, 2, 23, 198, 20, 3, 99, 83, 217, 13, 110, 28, 16, 6, 5, 3, 144, 31, 9, 187, 176, 145, 75, 11, 43, 424, 4, 54, 272, 8, 26, 131, 123, 107, 8, 4, 52, 9, 127, 84, 264, 33, 145, 663, 16, 285
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 22 2014

Keywords

Comments

Conjecture: (i) We always have 0 < a(n) < 3*prime(n) + 9.
(ii) For any integer n > 3, there is a positive integer k < 5*n^3 such that prime(k*n), prime((k+1)*n), prime((k+2)*n), and prime((k+3)*n) form a 4-term arithmetic progression.
(iii) In general, for each m = 3, 4, ..., if n is sufficiently large then there is a positive integer k = O(n^(m-1)) such that prime((k+j)*n) (j = 0, ..., m-1) form an arithmetic progression.
The conjecture is a refinement of the Green-Tao theorem.

Examples

			a(2) = 2 since prime(2*2) = 7, prime(3*2) = 13 and prime(4*2) = 19 form a 3-term arithmetic progression, but prime(1*2) = 3,  prime(2*2) = 7 and prime(3*2) = 13 do not form a 3-term arithmetic progression.
		

Crossrefs

Programs

  • Mathematica
    d[k_,n_]:=Prime[(k+1)*n]-Prime[k*n]
    Do[Do[If[d[k,n]==d[k+1,n],Print[n," ",k];Goto[aa]],{k,1,3*Prime[n]+8}];
    Print[n," ",0];Label[aa];Continue,{n,1,80}]
  • PARI
    okpr(p, q, r) = (q - p) == (r - q);
    a(n) = {k = 1; while(! okpr(prime(k*n), prime((k+1)*n), prime((k+2)*n)), k++); k;} \\ Michel Marcus, Aug 28 2014

A239328 Number of primes p < n with pi(p*n) - pi((p-1)n) prime, where pi(x) denotes the number of primes not exceeding x.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 16 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 3. Also, for any integer n > 4, there is a prime p < n with pi((p+1)*n) - pi(p*n) prime.
We have verified that a(n) > 0 for all n = 4, ..., 7*10^5.

Examples

			a(4) = 1 since 2 and pi(2*4) - pi(1*4) = 4 - 2 = 2 are both prime.
a(5) = 1 since 3 and pi(3*5) - pi(2*5) = 6 - 4 = 2 are both prime.
a(17) = 1 since 11 and pi(11*17) - pi(10*17) = 42 - 39 = 3 are both prime.
a(47) = 1 since 37 ad pi(37*47) - pi(36*47) = 270 - 263 = 7 are both prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_,k_]:=PrimeQ[PrimePi[Prime[k]*n]-PrimePi[(Prime[k]-1)*n]]
    a[n_]:=Sum[If[p[n,k],1,0],{k,1,PrimePi[n-1]}]
    Table[a[n],{n,1,80}]

A230022 a(n) = |{the number of primes in the interval (k*n, (k+1)*n]: k = 0, 1, ..., n-1}|.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 23 2014

Keywords

Comments

Conjecture: (i) a(n) is at least sqrt(n-1) for each n > 0, and equality holds only when n is 2 or 26.
(ii) The sequence contains all positive integers.
We have verified part (i) of the conjecture for n up to 10000.

Examples

			a(1) = 1 since the interval (0,1*1] contains no prime, and the set {0} has cardinaly 1.
a(3) = 2 since the intervals (0, 1*3], (1*3, 2*3], (2*3, 3*3] contain exactly 2, 1, 1 primes respectively, and the set {2, 1, 1} has cardinality 2.
		

Crossrefs

Programs

  • Mathematica
    d[k_,n_]:=PrimePi[(k+1)*n]-PrimePi[k*n]
    a[n_]:=Length[Union[Table[d[k,n],{k,0,n-1}]]]
    Table[a[n],{n,1,80}]
Showing 1-5 of 5 results.