login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A163757 The count of primes between the n-th unsafe and the n-th safe prime. 1
1, 1, 0, 1, 6, 6, 11, 15, 25, 26, 32, 37, 49, 51, 54, 68, 67, 70, 76, 79, 98, 115, 118, 121, 132, 136, 159, 171, 176, 176, 178, 185, 192, 196, 210, 234, 244, 258, 258, 259, 264, 275, 308, 308, 318, 351, 357, 359, 365, 367, 370, 379, 382, 386, 418, 438, 455, 457, 462, 473, 477 (list; graph; refs; listen; history; text; internal format)
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.
LINKS
FORMULA
a(n) = max( 0, A000720(A005385(n)-1)-A000720(A059456(n)) ).
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:
A163757 := proc(n) max(0, A000720(A005385(n)-1)-A000720(A059456(n))) ; end: seq(A163757(n), n=1..80) ; # R. J. Mathar, Aug 06 2009
CROSSREFS
Sequence in context: A046605 A095899 A346530 * A109538 A212534 A173319
KEYWORD
nonn
AUTHOR
EXTENSIONS
Corrected by R. J. Mathar, Aug 06 2009
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 19:39 EDT 2024. Contains 371963 sequences. (Running on oeis4.)