cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A163757 The count of primes between the n-th unsafe and the n-th safe prime.

This page as a plain text file.
%I A163757 #8 Mar 08 2019 03:29:48
%S A163757 1,1,0,1,6,6,11,15,25,26,32,37,49,51,54,68,67,70,76,79,98,115,118,121,
%T A163757 132,136,159,171,176,176,178,185,192,196,210,234,244,258,258,259,264,
%U A163757 275,308,308,318,351,357,359,365,367,370,379,382,386,418,438,455,457,462,473,477
%N A163757 The count of primes between the n-th unsafe and the n-th safe prime.
%C A163757 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.
%F A163757 a(n) = max( 0, A000720(A005385(n)-1)-A000720(A059456(n)) ).
%e A163757 a(1)=1 counts one prime (the 3) between 2 and 5;
%e A163757 a(2)=1 counts one prime (the 5) between 3 and 7;
%e A163757 a(5)=6 counts the primes from 23 to 43 between 19 and 53.
%p A163757 isA005385 := proc(n) if isprime(n) then isprime( (n-1)/2 ) ; else false; fi; end:
%p A163757 isA059456 := proc(n) if isprime(n) then not isprime( (n-1)/2 ) ; else false; fi; end:
%p A163757 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:
%p A163757 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:
%p A163757 A000720 := proc(n) numtheory[pi](n) ; end:
%p A163757 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
%Y A163757 Cf. A000040, A005385, A059456.
%K A163757 nonn
%O A163757 1,5
%A A163757 _Juri-Stepan Gerasimov_, Aug 03 2009
%E A163757 Corrected by _R. J. Mathar_, Aug 06 2009