Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #17 Oct 21 2024 14:32:26
%S 0,0,0,0,0,0,1,2,2,2,2,3,2,3,4,1,3,3,0,4,4,2,2,3,3,3,6,3,4,6,0,5,5,1,
%T 6,4,3,5,6,4,3,9,3,2,8,2,4,7,2,4,3,3,5,5,6,4,9,4,4,11,2,5,10,1,4,4,4,
%U 4,4,5,2,7,4,4,9,2,5,6,0,6,7,5,3,6,5,1,10,7,4,9,2,5,9,2,6,5,4,5,4,4
%N a(n) is the number of primes p such that p - 6, p + 6 and 2*n - p are also primes.
%C Conjecture: a(n) = 0 only when n = 1, 2, 3, 4, 5, 6, 19, 31, 331, 499.
%e a(7) = 1 since only when p = 11 are p - 6, p + 6 and 2n - p all prime.
%e a(12) = 3 from the cases when p is 11, 13 or 17:
%e when p = 11, {p - 6, p + 6, 2n - p} = {5, 17, 13} are all prime;
%e when p = 13, {p - 6, p + 6, 2n - p} = {7, 13, 19, 11} are all prime;
%e when p = 17, {p - 6, p + 6, 2n - p} = {11, 17, 23, 7} are all prime.
%e a(19) = 0 since 2n = 38 = 7 + 31 = 19 + 19 = 31 + 7, and none of p = 7, 19, 31 can make p - 6 and p + 6 both prime.
%p f:= proc(n) local i;
%p nops(select(p -> andmap(isprime,[p,p-6,p+6, 2*n-p]), [seq(i,i=3..2*n,2)]))
%p end proc:
%p map(f, [$1..100]); # _Robert Israel_, Oct 13 2024
%t m = 200; ps = {}; p = 7; While[p = NextPrime[p]; If[PrimeQ[p - 6] && PrimeQ[p + 6], AppendTo[ps, p]]; p < 2*m]; a = {}; Do[ct = 0; k = 0; While[k++; ps[[k]] < n, q = n - ps[[k]]; If[PrimeQ[q], ct++]]; AppendTo[a, ct]; If[ct == 0, AppendTo[b, n]], {n, 2, m, 2}]; a
%Y Cf. A006489, A045917.
%K nonn,easy
%O 1,8
%A _Lei Zhou_, Oct 12 2024