login
The number of nonisolated primes between the n-th nonisolated nonprime and the n-th isolated nonprime.
1

%I #12 Feb 18 2019 11:12:45

%S 1,2,1,3,5,5,7,9,9,11,13,15,17,19,21,23,23,25,27,29,31,33,35,37,37,39,

%T 41,43,45,47,49,51,53,55,57,59,61,61,63,65,67,69,71,73,75,75,77,79,81,

%U 83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,119

%N The number of nonisolated primes between the n-th nonisolated nonprime and the n-th isolated nonprime.

%e a(1)=1 (0 < 3 < 4);

%e a(2)=2 (1 < 3,5 < 6);

%e a(3)=1 (8 < 11 <12);

%e a(4)=3 (9 < 11,13,17 < 18);

%e a(5)=5 (10 < 11,13,17,19,29 < 30);

%e a(6)=5 (14 < 17,19,29,31,41 < 42);

%e a(7)=7 (15 < 17,19,29,31,41,43,59 < 60);

%e a(8)=9 (16 < 17,19,29,31,41,43,59,61,71 < 72).

%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 A001097 := proc(n) option remember; if n =1 then 3; else for a from procname(n-1)+2 by 2 do if isA001097(a) then return a; end if; end do: end if; end proc:

%p A167595 := proc(n) a := 0 ; for k from A164276(n)+1 to A014574(n)-1 do if isA001097(k) then a := a+1 ; end if; end do: a ; end proc:

%p seq(A167595(n),n=1..120) ; # _R. J. Mathar_, May 30 2010

%Y Cf. A001097 (the nonisolated primes), A014574 (the isolated nonprimes), A164276 (the nonisolated nonprimes), A167511.

%K nonn,easy

%O 1,2

%A _Juri-Stepan Gerasimov_, Nov 06 2009

%E More terms from _R. J. Mathar_, May 30 2010