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 A023201 #69 Apr 17 2025 14:55:40 %S A023201 5,7,11,13,17,23,31,37,41,47,53,61,67,73,83,97,101,103,107,131,151, %T A023201 157,167,173,191,193,223,227,233,251,257,263,271,277,307,311,331,347, %U A023201 353,367,373,383,433,443,457,461,503,541,557,563,571,587,593,601,607,613,641,647 %N A023201 Primes p such that p + 6 is also prime. (Lesser of a pair of sexy primes.) %H A023201 T. D. Noe, <a href="/A023201/b023201.txt">Table of n, a(n) for n = 1..10000</a> %H A023201 Maxie D. Schmidt, <a href="https://arxiv.org/abs/1701.04741">New Congruences and Finite Difference Equations for Generalized Factorial Functions</a>, arXiv:1701.04741 [math.CO], 2017. %H A023201 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]. %H A023201 Wikipedia, <a href="https://en.wikipedia.org/wiki/Sexy_prime">Sexy prime</a>. %F A023201 From _M. F. Hasler_, Jan 02 2020: (Start) %F A023201 a(n) = A046117(n) - 6 = A087695(n) - 3. %F A023201 A023201 = { p = A000040(k) | A000040(k+1) = p+6 or A000040(k+2) = p+6 } = A031924 U A007529. (End) %p A023201 A023201 := proc(n) %p A023201 option remember; %p A023201 if n = 1 then %p A023201 5; %p A023201 else %p A023201 for a from procname(n-1)+2 by 2 do %p A023201 if isprime(a) and isprime(a+6) then %p A023201 return a; %p A023201 end if; %p A023201 end do: %p A023201 end if; %p A023201 end proc: # _R. J. Mathar_, May 28 2013 %t A023201 Select[Range[10^2], PrimeQ[ # ]&&PrimeQ[ #+6] &] (* _Vladimir Joseph Stephan Orlovsky_, Apr 29 2008 *) %t A023201 Select[Prime[Range[120]],PrimeQ[#+6]&] (* _Harvey P. Dale_, Mar 20 2018 *) %o A023201 (Magma) [n: n in [0..40000] | IsPrime(n) and IsPrime(n+6)]; // _Vincenzo Librandi_, Aug 04 2010 %o A023201 (Haskell) %o A023201 a023201 n = a023201_list !! (n-1) %o A023201 a023201_list = filter ((== 1) . a010051 . (+ 6)) a000040_list %o A023201 -- _Reinhard Zumkeller_, Feb 25 2013 %o A023201 (PARI) is(n)=isprime(n+6)&&isprime(n) \\ _Charles R Greathouse IV_, Mar 20 2013 %Y A023201 A031924 (primes starting a gap of 6) and A007529 together give this (A023201). %Y A023201 Cf. A046117 (a(n)+6), A087695 (a(n)+3), A098428, A000040, A010051, A006489 (subsequence). %K A023201 nonn,easy %O A023201 1,1 %A A023201 _David W. Wilson_