A297925 Even numbers k such that k - 5 is prime but k - 3 is not prime.
12, 18, 24, 28, 36, 42, 48, 52, 58, 66, 72, 78, 84, 88, 94, 102, 108, 114, 118, 132, 136, 144, 156, 162, 168, 172, 178, 186, 198, 204, 216, 228, 234, 238, 246, 256, 262, 268, 276, 282, 288, 298, 312, 318, 322, 336, 342, 354, 358, 364, 372, 378, 384, 388, 394, 402, 406, 414, 426, 438, 444, 448, 454
Offset: 1
Keywords
Examples
12 is a term because 12 - 5 = 7 is prime, and 12 - 3 = 9 is composite. Also A049591(1)+5=7+5=12 and A107986(2)+3=9+3=12. 18 is a term because 18 - 5 = 13 is prime, and 18 - 3 = 15 is composite. 16 is not a term because 16 - 5 = 11 and 16 - 3 = 13 are both prime.
Links
- G. C. Greubel, Table of n, a(n) for n = 1..10000
Programs
-
GAP
Filtered([8..500], k-> IsPrime(k-5) and not IsPrime(k-3) and (k mod 2)=0); # G. C. Greubel, May 21 2019
-
Magma
[n: n in [3..500] | IsPrime(n-5) and not IsPrime(n-3) and (n mod 2) eq 0]; // G. C. Greubel, May 21 2019
-
Maple
N:=100 for n from 8 to N by 2 do if isprime(n-5) and not isprime(n-3) then print (n); end if end do
-
Mathematica
Select[Range[6, 500, 2], And[PrimeQ[# - 5], ! PrimeQ[# - 3]] &] (* Michael De Vlieger, Jan 10 2018 *) Select[Range[6, 500, 2], Boole[PrimeQ[# -{5, 3}]] == {1, 0} &] (* Harvey P. Dale, Jan 30 2024 *)
-
PARI
isok(n) = !(n % 2) && isprime(n-5) && !isprime(n-3); \\ Michel Marcus, Jan 09 2018
-
Sage
[n for n in (3..500) if is_prime(n-5) and not is_prime(n-3) and (mod(n, 2)==0)] # G. C. Greubel, May 21 2019
Comments