A298366 Even numbers n such that n-5 and n-3 are both composite.
30, 38, 54, 60, 68, 80, 90, 96, 98, 120, 122, 124, 126, 128, 138, 146, 148, 150, 158, 164, 174, 180, 188, 190, 192, 206, 208, 210, 212, 218, 220, 222, 224, 240, 248, 250, 252, 258, 264, 270, 278, 290, 292, 294, 300, 302, 304, 306, 308, 324, 326, 328, 330, 332, 338, 344, 346, 348, 360, 366, 368, 374, 380
Offset: 1
Keywords
Examples
30 is included because 30-5 = 25, and 30-3 = 27; both composite, and 30 is the smallest even number with this property, hence a(1)=30. Also, A056240(a(1)) = A056240(30) = 161 = A298615(1). 24 is not included because although 24 - 3 = 21, composite; 24 - 5 = 19, prime. 210 is in this sequence, since 205 and 207 are both composite. 113 is the first prime to have a gap 14 ahead of it. Therefore we would expect a run of (14 - 4)/2 = 5 consecutive terms to start at 7 + A000230(7) = 113 + 7 = 120; thus: 120,122,124,126,128. Likewise the first occurrence of run length 7 occurs at gap m = 2*7 + 4 = 18, namely the term corresponding to 7 + A000230(9) = 523 + 7 = 530; thus: 530,532,534,536,538,540,542.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..7000
Programs
-
Magma
[2*n: n in [8..200] | not IsPrime(2*n-5) and not IsPrime(2*n-3)]; // Vincenzo Librandi, Nov 16 2018
-
Maple
N:=300: for n from 8 to N by 2 do if not isprime(n-5) and not isprime(n-3) then print(n); end if end do
-
Mathematica
Rest[2 Select[Range[250], !PrimeQ[2 # - 5] && !PrimeQ[2 # - 3] &]] (* Vincenzo Librandi, Nov 16 2018 *) Select[Range[2,400,2],AllTrue[#-{3,5},CompositeQ]&] (* Harvey P. Dale, Jul 01 2025 *)
-
PARI
select( is_A298366(n)=!(isprime(n-5)||isprime(n-3)||bitand(n,1)||n<9), [5..200]*2) \\ Last 2 conditions aren't needed if n > 4 and even. - M. F. Hasler, Nov 19 2018 and Apr 07 2020 after edit by Michel Marcus, Apr 04 2020
Comments