OFFSET
1,2
COMMENTS
Instead of "isolated" one speaks also of "single" primes, they are listed in A007510 and include 2 by convention. By isolated composites are meant composites whose two neighbors both are prime, i.e., the averages of twin primes, A014574. - M. F. Hasler, Aug 11 2015
EXAMPLE
a(1) = 1 = # { 3 }, the only prime between 2 (the first "isolated prime" according to A007510) and 4, the first "isolated composite" in the sense that x-1 and x+1 both are primes.
a(2) = 5 = # { 7, 11, 13, 17, 19 }, the primes between the second isolated prime, 23, and second isolated composite, 6.
MAPLE
A007510 := proc(n) if n = 1 then 2; else for a from procname(n-1)+1 do if isA007510(a) then return a; end if; end do; end if; end proc:
isA007510 := proc(n) isprime(n) and not isprime(n+2) and not isprime(n-2) ; simplify(%) ; end proc:
A101288 := proc(n) if n = 1 then return 1 ; end if; a7510 := A007510(n) ; a4574 := A014574(n) ; if a7510 > a4574 then numtheory[pi](a7510-1)-numtheory[pi](a4574) ; else numtheory[pi](a4574)-numtheory[pi](a7510+1) ; end if; end proc:
seq(A101288(n), n=1..120) ; # R. J. Mathar, Apr 25 2010
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Nov 02 2009
EXTENSIONS
More terms from R. J. Mathar, Apr 25 2010
Edited by Jon E. Schoenfield and M. F. Hasler, Aug 11 2015
STATUS
approved
