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.

A140546 Primes p such that neither p - 6 nor p + 6 is prime.

Original entry on oeis.org

2, 3, 71, 127, 139, 149, 181, 211, 241, 281, 293, 349, 397, 401, 409, 419, 421, 431, 479, 487, 491, 499, 521, 523, 617, 631, 643, 661, 673, 691, 701, 709, 719, 743, 761, 769, 773, 787, 797, 809, 811, 839, 907, 911, 919, 929, 937, 967, 1009, 1021, 1031, 1049
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 30 2008

Keywords

Crossrefs

Cf. A136207 (complement)

Programs

  • Maple
    isA140546 := proc(n)
        if isprime(n) then
            if isprime(n+6) or isprime(n-6) then
                false;
            else
                true;
            end if;
        else
            false ;
        end if;
    end proc:
    A140546 := proc(n)
        option remember;
        local a;
        if n = 1 then
            2 ;
        else
            a := nextprime(procname(n-1)) ;
            while true do
                if isA140546(a) then
                    return a;
                else
                    a := nextprime(a) ;
                end if;
            end do:
        end if;
    end proc:
    seq(A140546(n),n=1..80) ; # R. J. Mathar, Jun 10 2024
  • Mathematica
    Select[Prime[Range[176]],!PrimeQ[#+6]&&(!PrimeQ[#-6]||#<5)&] (* James C. McMahon, Jul 12 2025 *)

Extensions

Corrected and extended by Charles R Greathouse IV, Mar 25 2010