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.

A237715 Number of ordered ways to write n = p + q (q > 0) with p, prime(p) - p + 1 and prime(prime(q)) - prime(q) + 1 all prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 06 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 2, and a(n) = 1 only for n = 3.

Examples

			a(3) = 1 since 3 = 2 + 1 with 2, prime(2) - 2 + 1 = 3 - 1 = 2 and prime(prime(1)) - prime(1) + 1 = prime(2) - 2 + 1  = 2 all prime.
a(7) = 2 since 7 = 3 + 4 with 3, prime(3) - 3 + 1 = 5 - 2 = 3 and prime(prime(4)) - prime(4) + 1 = prime(7) - 7 + 1 = 17 - 6 = 11 are all prime, and 7 = 5 + 2 with 5, prime(5) - 5 + 1 = 11 - 4 = 7 and prime(prime(2)) - prime(2) + 1 = prime(3) - 3 + 1 = 5 - 2 = 3 all prime.
		

Crossrefs

Programs

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