%I #8 Feb 18 2019 11:11:43
%S 3,3,11,11,11,17,17,17,29,29,29,29,29,29,29,29,41,41,41,41,41,41,41,
%T 41,59,59,59,59,59,59,59,59,59,59,59,59,59,71,71,71,71,71,71,71,71,
%U 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101
%N Smallest non-isolated (or twin) prime > n-th non-isolated nonprime.
%e a(1)=3 (>0); a(2)=3 (>1); a(3)=11 (>8); a(4)=11 (>8); a(5)=11 (>10); a(6)=17 (>14).
%p A164276 := proc(n) option remember; if n = 1 then 0; else for a from procname(n-1)+1 do if isA164276(a) then return a; end if; end do; end if: end proc:
%p isA164276 := proc(n) not isprime(n) and ( not isprime(n+1) or not isprime(n-1) ) ; end proc:
%p isA001097 := proc(n) isprime(n) and ( isprime(n+2) or isprime(n-2) ); end proc:
%p A167428 := proc(n) for a from A164276(n)+1 do if isA001097(a) then return a; end if; end do: end proc:
%p seq(A167428(n),n=1..120) ; # _R. J. Mathar_, May 30 2010
%Y Cf. A001097, A164276.
%K nonn
%O 1,1
%A _Juri-Stepan Gerasimov_, Nov 03 2009
%E Entries checked by _R. J. Mathar_, May 30 2010