%I
%S 3,17,41,107,71,2267,1091,461,1319,1151,347,5741,2999,5279,10139,1487,
%T 9461,881,659,13007,9041,15359,8627,28751,83717,13397,18539,14627,
%U 44771,54011,60257,59669,142157,77711,61559,178931,26261,122867,293261,89069,24419
%N Smallest prime p such that n primes exist between the twin prime pair (p, p+2) and the next twin prime pair.
%e a(4)= 71 because the 4 primes 79, 83, 89, 97 exist between (71, 73) and (101,103).
%p A181981 := proc(n)
%p local j,hi,lo ;
%p if n = 0 then
%p 3;
%p else
%p for j from 1 do
%p hi := numtheory[pi](A001359(j+1)) ;
%p lo := numtheory[pi](A006512(j)) ;
%p if hi-lo = n+1 then
%p return A001359(j);
%p end if;
%p end do:
%p end if;
%p end proc: # _R. J. Mathar_, Jul 03 2012
%Y Cf. A001359, A006512, A027833.
%K nonn
%O 0,1
%A _Michel Lagneau_, Jul 03 2012
|