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.

A237705 Number of primes p < n with pi(n-p) prime, where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 11 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 4, and a(n) = 1 only for n = 5, 12, 26, 27, 32, 68.
(ii) For any integer n > 5, there is a prime p <= n with pi(n+p) prime.
(iii) If n > 32, then pi((n-p)^2) is prime for some prime p < n. Also, for each n > 6 there is an odd prime p < 2*n with pi((n - (p-1)/2)^2) prime.
(iv) Any integer n > 11 can be written as p + q with p and pi(q^2 + q + 1) both prime.
(v) Each integer n > 34 can be written as k + m with k and m positive integers such that pi(k^2) and pi(2*m^2) are both prime.

Examples

			a(5) = 1 since 2 and pi(5-2) = pi(3) = 2 are both prime.
a(12) = 1 since 7 and pi(12-7) = pi(5) = 3 are both prime.
a(15) = 2 since 3 and pi(15-3) = pi(12) = 5 are both prime, and 11 and pi(15-11) = pi(4) = 2 are both prime.
a(26) = 1 since 23 and pi(26-23) = 2 are both prime.
a(27) = 1 since 23 and pi(27-23) = 2 are both prime.
a(32) = 1 since 29 and pi(32-29) = 2 are both prime.
a(68) = 1 since 37 and pi(68-37) = pi(31) = 11 are both prime.
		

Crossrefs

Programs

  • Mathematica
    q[n_]:=PrimeQ[PrimePi[n]]
    a[n_]:=Sum[If[q[n-Prime[k]],1,0],{k,1,PrimePi[n-1]}]
    Table[a[n],{n,1,70}]