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.
%I A098428 #17 Feb 16 2025 08:32:54 %S A098428 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, %T A098428 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, %U A098428 12,12,12,12,12,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,15,15,15 %N A098428 Number of sexy prime pairs (p, p+6) with p <= n. %C A098428 Since there are 2 congruence classes of sexy prime pairs, (-1, -1) (mod 6) and (+1, +1) (mod 6), the number of sexy prime pairs up to n is the sum of the number of sexy prime pairs for each class, expected to be asymptotically the same for both (with the expected Chebyshev bias against the quadratic residue class (+1, +1) (mod 6), which doesn't affect the asymptotic distribution among the 2 classes). - _Daniel Forgues_, Aug 05 2009 %H A098428 Daniel Forgues, <a href="/A098428/b098428.txt">Table of n, a(n) for n=1..99994</a> %H A098428 Eric Weisstein's World of Mathematics, <a href="https://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] %F A098428 a(n) = # { p in A023201 | p <= n } = number of elements in intersection of A023201 and [1,n]. - _M. F. Hasler_, Jan 02 2020 %e A098428 The first sexy prime pairs are: (5,11), (7,13), (11,17), (13,19), ... %e A098428 therefore the sequence starts: 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 4, ... %t A098428 Accumulate[Table[If[PrimeQ[n]&&PrimeQ[n+6],1,0],{n,100}]] (* _Harvey P. Dale_, Feb 08 2015 *) %o A098428 (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 %o A098428 [#[p:p in PrimesInInterval(1,n)| IsPrime(p+6)]:n in [1..100]]; // _Marius A. Burtea_, Jan 03 2020 %Y A098428 Cf. A023201, A046117, A098424, A071538, A098429. %K A098428 nonn %O A098428 1,7 %A A098428 _Reinhard Zumkeller_, Sep 07 2004 %E A098428 Edited by _Daniel Forgues_, Aug 01 2009, _M. F. Hasler_, Jan 02 2020