login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A140546 Primes p such that neither p - 6 nor p + 6 is prime. 5

%I #8 Jun 10 2024 07:04:15

%S 2,3,71,127,139,149,181,211,241,281,293,349,397,401,409,419,421,431,

%T 479,487,491,499,521,523,617,631,643,661,673,691,701,709,719,743,761,

%U 769,773,787,797,809,811,839,907,911,919,929,937,967,1009,1021,1031,1049

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

%H N. J. A. Sloane, <a href="/A140546/b140546.txt">Table of n, a(n) for n = 1..10000</a>

%p isA140546 := proc(n)

%p if isprime(n) then

%p if isprime(n+6) or isprime(n-6) then

%p false;

%p else

%p true;

%p end if;

%p else

%p false ;

%p end if;

%p end proc:

%p A140546 := proc(n)

%p option remember;

%p local a;

%p if n = 1 then

%p 2 ;

%p else

%p a := nextprime(procname(n-1)) ;

%p while true do

%p if isA140546(a) then

%p return a;

%p else

%p a := nextprime(a) ;

%p end if;

%p end do:

%p end if;

%p end proc:

%p seq(A140546(n),n=1..80) ; # _R. J. Mathar_, Jun 10 2024

%Y Cf. A136207 (complement)

%K nonn,easy

%O 1,1

%A _Juri-Stepan Gerasimov_, Jun 30 2008

%E Corrected and extended by _Charles R Greathouse IV_, Mar 25 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 16 20:35 EDT 2024. Contains 375977 sequences. (Running on oeis4.)