login
Smallest prime p such that n primes exist between the prime triple (p, p+2, p+6) and the next prime triple.
1

%I #8 Feb 21 2023 09:59:43

%S 5,857,311,17,31391,3461,1427,12917,1997,4517,41,20747,107,1871,1487,

%T 4637,2081,347,7877,23057,80777,1091,18041,641,461,5231,21017,881,

%U 4967,45821,1607,15731,165311,17027,35591,26261,11777,8537,64151,101111,82757,23741

%N Smallest prime p such that n primes exist between the prime triple (p, p+2, p+6) and the next prime triple.

%e a(3)= 17 because there exists 3 primes 29, 31 and 37 are between (17, 19,23) and (41,43,47).

%p A214450 := 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]( A022004 (j+1)) ;

%p lo := numtheory[pi]( A098412 (j)) ;

%p if hi-lo = n+1 then

%p return A022004 (j);

%p end if;

%p end do:

%p end if;

%p end proc: # [Program from R. J. Mathar, adapted for this sequence (see A089637)].

%Y Cf. A022004, A098412, A089637.

%K nonn

%O 0,1

%A _Michel Lagneau_, Jul 18 2012