A237260 Least positive integer m < n with prime(prime(m)) + 2 and prime(n-m) + 2 both prime, or 0 if such a number m does not exist.
0, 0, 1, 1, 2, 1, 2, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 4, 23, 6, 1, 2, 1, 2, 3, 4, 7, 1, 2, 1, 2, 3, 4, 7, 6, 1, 2, 1, 2, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 4, 14, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 24, 1
Offset: 1
Keywords
Examples
a(5) = 2 since prime(prime(2)) + 2 = prime(3) + 2 = 7 and prime(5-2) + 2 = 7 are both prime, but prime(5-1) + 2 = 7 + 2 = 9 is composite.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Z.-W. Sun, Problems on combinatorial properties of primes, arXiv:1402.6641, 2014
Programs
-
Mathematica
pq[k_,m_]:=PrimeQ[Prime[k]+2]&&PrimeQ[Prime[Prime[m]]+2] Do[Do[If[pq[n-m,m],Print[n," ",m];Goto[aa]],{m,1,n-1}]; Print[n," ",0];Label[aa];Continue,{n,1,70}]
Comments