%I #16 May 26 2014 04:35:56
%S 1,1,1,1,2,2,2,3,2,1,2,2,3,3,4,2,3,5,2,5,5,2,3,5,4,3,5,5,3,7,3,3,7,4,
%T 5,6,3,5,7,4,4,6,5,4,8,3,6,9,5,6,7,4,5,8,6,3,6,4,3,11,5,4,10,5,6,9,7,
%U 7,10,6,3,10,6,5,12,7,6,11,5,9,12,5,7,12,8,6,10,6,7,14,7,6,11,8,9,12,7,9
%N Number of times 2n+p is prime, with p=1 or prime p < n.
%H Robert Israel, <a href="/A071137/b071137.txt">Table of n, a(n) for n = 1..10000</a>
%e a(11) = 2 because 22 + 1 and 22 + 7 are primes.
%p N:= 100: # to get the first N entries
%p Primes:= {1} union select(isprime,{seq(2*j+1, j=1..floor(3*N/2))}):
%p f:= proc(n) local A; A:= select(`<`,Primes,3*n);
%p nops(A intersect map(`+`,A,2*n));
%p end proc;
%p 1, seq(f(n), n=2..N); # _Robert Israel_, May 25 2014
%t For[A071137 = {}; n = 1, n <= 100, n++, If[PrimeQ[2n + 1], cnt = 1, cnt = 0]; k = 1; While[Prime[k] < n, If[PrimeQ[2n + Prime[k]], cnt++ ]; k++ ]; AppendTo[A071137, cnt]]; A071137 (* Noe *)
%t Table[Length[Select[Range[PrimePi[n]], PrimeQ[2n + Prime[#]] &]] + Boole[PrimeQ[2n + 1]], {n, 80}] (* _Alonso del Arte_, May 25 2014 *)
%Y Cf. A071127.
%K easy,nonn
%O 1,5
%A _T. D. Noe_, May 28 2002