OFFSET
1,8
COMMENTS
LINKS
Lei Zhou, Table of n, a(n) for n = 1..10000
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].
Lei Zhou, Plot of a(n) for n <= 20000.
EXAMPLE
n=7, 2n=14=3+11. 11-3=8, 5<8<11 where {5, 11} is a pair of sexy primes. So a(7)=1.
n=8, 2n=16=3+13=5+11. 13-3=10, 5<10<11; 11-5=6, 5<6<11, where {5, 11} is a pair of sexy primes: two cases found, so a(8)=2.
n=17, 2n=34=3+31=5+29=11+23. 31-3=28, 23<28<29; 29-5=24, 23<24<29; 23-11=12, 7<12<13; where {23,29} and {7,13} are sexy prime pairs: three cases found, so a(17)=3.
MATHEMATICA
Table[e = 2 n; ct = 0; p1 = 1; While[p1 = NextPrime[p1]; p1 < n, p2 = e - p1; If[PrimeQ[p2], c = p2 - p1; If[c >= 6, found = 0; Do[If[PrimeQ[c - i] && PrimeQ[c + 6 - i], found = 1], {i, 1, 5, 2}]; If[found == 1, ct++]]]]; ct, {n, 1, 100}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Lei Zhou, Feb 05 2015
EXTENSIONS
Edited by Wolfdieter Lang, Feb 20 2015
STATUS
approved