A098428 Number of sexy prime pairs (p, p+6) with p <= n.
0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15
Offset: 1
Keywords
Examples
The first sexy prime pairs are: (5,11), (7,13), (11,17), (13,19), ... therefore the sequence starts: 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 4, ...
Links
- Daniel Forgues, Table of n, a(n) for n=1..99994
- Eric Weisstein's World of Mathematics, Sexy Primes. [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]
Programs
-
Mathematica
Accumulate[Table[If[PrimeQ[n]&&PrimeQ[n+6],1,0],{n,100}]] (* Harvey P. Dale, Feb 08 2015 *)
-
PARI
apply( {A098428(n,o=2,q=o,c)=forprime(p=1+q, n+6, (o+6==p)+((o=q)+6==q=p) && c++);c}, [1..99]) \\ M. F. Hasler, Jan 02 2020 [#[p:p in PrimesInInterval(1,n)| IsPrime(p+6)]:n in [1..100]]; // Marius A. Burtea, Jan 03 2020
Formula
a(n) = # { p in A023201 | p <= n } = number of elements in intersection of A023201 and [1,n]. - M. F. Hasler, Jan 02 2020
Extensions
Edited by Daniel Forgues, Aug 01 2009, M. F. Hasler, Jan 02 2020
Comments