OFFSET
1,5
COMMENTS
For n=3, where the 3rd unsafe prime is larger than the 3rd safe prime, there are two primes in between which could formally be counted as -2, but have been replaced by 0 here.
EXAMPLE
a(1)=1 counts one prime (the 3) between 2 and 5;
a(2)=1 counts one prime (the 5) between 3 and 7;
a(5)=6 counts the primes from 23 to 43 between 19 and 53.
MAPLE
isA005385 := proc(n) if isprime(n) then isprime( (n-1)/2 ) ; else false; fi; end:
isA059456 := proc(n) if isprime(n) then not isprime( (n-1)/2 ) ; else false; fi; end:
A059456 := proc(n) if n = 1 then 2; else for a from procname(n-1)+1 do if isA059456(a) then RETURN(a) ; fi; od: fi; end:
A005385 := proc(n) if n = 1 then 5; else for a from procname(n-1)+1 do if isA005385(a) then RETURN(a) ; fi; od: fi; end:
A000720 := proc(n) numtheory[pi](n) ; end:
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Aug 03 2009
EXTENSIONS
Corrected by R. J. Mathar, Aug 06 2009
STATUS
approved