login
A167595
The number of nonisolated primes between the n-th nonisolated nonprime and the n-th isolated nonprime.
1
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, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 61, 63, 65, 67, 69, 71, 73, 75, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 119
OFFSET
1,2
EXAMPLE
a(1)=1 (0 < 3 < 4);
a(2)=2 (1 < 3,5 < 6);
a(3)=1 (8 < 11 <12);
a(4)=3 (9 < 11,13,17 < 18);
a(5)=5 (10 < 11,13,17,19,29 < 30);
a(6)=5 (14 < 17,19,29,31,41 < 42);
a(7)=7 (15 < 17,19,29,31,41,43,59 < 60);
a(8)=9 (16 < 17,19,29,31,41,43,59,61,71 < 72).
MAPLE
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:
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:
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:
seq(A167595(n), n=1..120) ; # R. J. Mathar, May 30 2010
CROSSREFS
Cf. A001097 (the nonisolated primes), A014574 (the isolated nonprimes), A164276 (the nonisolated nonprimes), A167511.
Sequence in context: A137655 A355621 A296064 * A328600 A179382 A161169
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from R. J. Mathar, May 30 2010
STATUS
approved