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!)
A309005 Odd squarefree composite numbers m such that m+2 is prime. 1

%I #31 Dec 03 2022 16:06:47

%S 15,21,35,39,51,57,65,69,77,87,95,105,111,129,155,161,165,177,195,209,

%T 221,231,237,249,255,267,291,305,309,329,335,345,357,365,371,377,381,

%U 395,399,407,417,429,437,447,455,465,485,489,497,501,519,545,555,561,591,597,611

%N Odd squarefree composite numbers m such that m+2 is prime.

%C The squarefree terms of A241809 and A136354 are in this sequence.

%H Amiram Eldar, <a href="/A309005/b309005.txt">Table of n, a(n) for n = 1..10000</a>

%e 15 = 3*5 is the smallest squarefree composite number m such that m+2 is prime; 15+2=17.

%p with(NumberTheory):

%p N := 500;

%p for n from 2 to N do

%p if IsSquareFree(n) and not mod(n, 2) = 0 and not isprime(n) and isprime(n+2) then print(n);

%p end if:

%p end do:

%t Select[Range[15, 611, 2], And[CompositeQ@ #, SquareFreeQ@ #, PrimeQ[# + 2]] &] (* _Michael De Vlieger_, Jul 08 2019 *)

%t Select[Prime[Range[2,150]]-2,SquareFreeQ[#]&&CompositeQ[#]&] (* _Harvey P. Dale_, Dec 03 2022 *)

%o (PARI) isok(n) = isprime(n+2) && (n%2) && (n>1) && !isprime(n) && issquarefree(n); \\ _Michel Marcus_, Jul 05 2019

%o (Magma) [n: n in [2..611] | IsPrime(n+2) and not IsPrime(n) and IsSquarefree(n)]; // _Vincenzo Librandi_, Jul 07 2019

%Y Cf. A024556, A241809, A136354.

%K nonn

%O 1,1

%A _David James Sycamore_, Jul 05 2019

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 March 28 14:13 EDT 2024. Contains 371254 sequences. (Running on oeis4.)