cp's OEIS Frontend

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.

A023201 Primes p such that p + 6 is also prime. (Lesser of a pair of sexy primes.)

Original entry on oeis.org

5, 7, 11, 13, 17, 23, 31, 37, 41, 47, 53, 61, 67, 73, 83, 97, 101, 103, 107, 131, 151, 157, 167, 173, 191, 193, 223, 227, 233, 251, 257, 263, 271, 277, 307, 311, 331, 347, 353, 367, 373, 383, 433, 443, 457, 461, 503, 541, 557, 563, 571, 587, 593, 601, 607, 613, 641, 647
Offset: 1

Views

Author

Keywords

Crossrefs

A031924 (primes starting a gap of 6) and A007529 together give this (A023201).
Cf. A046117 (a(n)+6), A087695 (a(n)+3), A098428, A000040, A010051, A006489 (subsequence).

Programs

  • Haskell
    a023201 n = a023201_list !! (n-1)
    a023201_list = filter ((== 1) . a010051 . (+ 6)) a000040_list
    -- Reinhard Zumkeller, Feb 25 2013
    
  • Magma
    [n: n in [0..40000] | IsPrime(n) and IsPrime(n+6)]; // Vincenzo Librandi, Aug 04 2010
    
  • Maple
    A023201 := proc(n)
        option remember;
        if n = 1 then
            5;
        else
            for a from procname(n-1)+2 by 2 do
                if isprime(a) and isprime(a+6) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, May 28 2013
  • Mathematica
    Select[Range[10^2], PrimeQ[ # ]&&PrimeQ[ #+6] &] (* Vladimir Joseph Stephan Orlovsky, Apr 29 2008 *)
    Select[Prime[Range[120]],PrimeQ[#+6]&] (* Harvey P. Dale, Mar 20 2018 *)
  • PARI
    is(n)=isprime(n+6)&&isprime(n) \\ Charles R Greathouse IV, Mar 20 2013

Formula

From M. F. Hasler, Jan 02 2020: (Start)
a(n) = A046117(n) - 6 = A087695(n) - 3.
A023201 = { p = A000040(k) | A000040(k+1) = p+6 or A000040(k+2) = p+6 } = A031924 U A007529. (End)