login
Numbers of primes between two sexy primes.
2

%I #11 Mar 07 2021 00:56:09

%S 1,1,1,1,1,0,0,1,1,0,0,0,1,0,0,1,1,1,1,0,0,0,0,0,1,1,1,1,0,0,0,0,0,1,

%T 1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,1,1,1,

%U 1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1

%N Numbers of primes between two sexy primes.

%H Robert Israel, <a href="/A104037/b104037.txt">Table of n, a(n) for n = 1..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SexyPrimes.html">Sexy Primes</a>. [The definition in this webpage is unsatisfactory, because it defines a "sexy prime" as a pair of primes.- _N. J. A. Sloane_, Mar 07 2021].

%p p:=1: q:= 0: r:= 1: s:= 1: count:= 0: Res:= NULL:

%p while count < 100 do

%p t:= charfcn[{true}](isprime(p+6));

%p if t=1 and q=1 then

%p count:= count + 1;

%p Res:= Res, r+s;

%p fi;

%p p:= p+2;

%p q:= r; r:= s; s:= t;

%p od:

%p Res; # _Robert Israel_, Jun 23 2019

%Y Cf. A023201 (sexy primes), A046117.

%K easy,nonn

%O 1,1

%A _Giovanni Teofilatto_, Mar 31 2005

%E Corrected and extended by _Robert Israel_, Jun 23 2019