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 A297847 #10 Jan 22 2018 08:13:35 %S A297847 0,0,4,2,3,1,2,0,1,0,2,1,3,0,2,1,0,3,2,0,1,0,1,0,2,2,1,1,0,0,0,1,0,0, %T A297847 0,2,1,0,2,1,0,0,1,1,0,0,0,1,2,0,1,0,0,3,2,1,0,2,1,0,0,0,1,1,0,0,1,0, %U A297847 2,0,1,0,2,1,0,1,0,0,0,0,0,0,0,1,0,1,0 %N A297847 Sexiness of p = prime(n): number of iterations of the function f(x) = x + 6 that leave p prime. %C A297847 a(n) > 0 iff p is a term of A023201. %C A297847 a(n) = 0 iff p is a term of A140555. %C A297847 a(n) = 2 iff p is a term of A046118. %C A297847 a(n) > 2 iff p is a term of A023271. %C A297847 a(n) < 4 except for n = 3. Proof: The last digits of the numbers in the progression repeat 1, 7, 3, 9, 5, 1, 7, 3, 9, 5, ..., so a(n) is at most 4, which only happens for p = 5, since A007652(n) = 5 only for n = 3. %H A297847 Wikipedia, <a href="https://en.wikipedia.org/wiki/Sexy_prime">Sexy prime</a> %e A297847 For n = 13: prime(13) = 41 and 41 remains prime through exactly 3 iterations of f(x) = x + 6, since 47, 53 and 59 are prime, but 65 is composite, so a(13) = 3. %t A297847 Array[-2 + Length@ NestWhileList[# + 6 &, Prime@ #, PrimeQ] &, 105] (* _Michael De Vlieger_, Jan 11 2018 *) %o A297847 (PARI) a(n) = my(p=prime(n), x=p, i=0); while(1, x=x+6; if(!ispseudoprime(x), return(i), i++)) %Y A297847 Cf. A023201, A023271, A046118, A140555. %K A297847 nonn %O A297847 1,3 %A A297847 _Felix Fröhlich_, Jan 07 2018