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.

A298366 Even numbers n such that n-5 and n-3 are both composite.

This page as a plain text file.
%I A298366 #35 Jul 01 2025 11:46:05
%S A298366 30,38,54,60,68,80,90,96,98,120,122,124,126,128,138,146,148,150,158,
%T A298366 164,174,180,188,190,192,206,208,210,212,218,220,222,224,240,248,250,
%U A298366 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
%N A298366 Even numbers n such that n-5 and n-3 are both composite.
%C A298366 The sequence displays runs of consecutive even integers, whose frequency and length are related to gaps between successive primes local to these numbers. Where primes are rare (large gaps), the runs of consecutive even integers are longer (run length proportional to gap size). Let p < q be consecutive primes such that g = q-p >= 6. A string of r consecutive terms differing by 2 will start at p+7, and continue to q+1, where r = (g-4)/2. Thus at prime gap 8 a string of 2 consecutive terms differing by 2 will occur, at gap 10 there will be 3, and at gap 30 there will be 13; and so on. As the gap size increases by 2 so the run length of consecutive even terms increases by 1. The first occurrence of run length m occurs at the term corresponding to 7 + A000230(m/2).
%C A298366 The terms in this sequence, combined with those in A297925 and A298252 form a partition of A005843(n); n >= 3; (nonnegative even numbers >= 6). This is because any even integer n >= 6 satisfies either: (i). n-3 is prime, (ii). n-5 is prime and n-3 is composite, or (iii). both n-5 and n-3 are composite.
%C A298366 For any n >= 1, A056240(a(n)) = A298615(n).
%H A298366 Vincenzo Librandi, <a href="/A298366/b298366.txt">Table of n, a(n) for n = 1..7000</a>
%F A298366 a(n) = A061673(n) + 4 = A269345(n) + 5. - _M. F. Hasler_, Nov 19 2018
%e A298366 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.
%p A298366 N:=300:
%p A298366 for n from 8 to N by 2 do
%p A298366 if not isprime(n-5) and not isprime(n-3) then print(n);
%p A298366 end if
%p A298366 end do
%t A298366 Rest[2 Select[Range[250], !PrimeQ[2 # - 5] && !PrimeQ[2 # - 3] &]] (* _Vincenzo Librandi_, Nov 16 2018 *)
%t A298366 Select[Range[2,400,2],AllTrue[#-{3,5},CompositeQ]&] (* _Harvey P. Dale_, Jul 01 2025 *)
%o A298366 (Magma) [2*n: n in [8..200] | not IsPrime(2*n-5) and not IsPrime(2*n-3)]; // _Vincenzo Librandi_, Nov 16 2018
%o A298366 (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
%Y A298366 Cf. A297925, A298252, A005843, A000230.
%K A298366 nonn
%O A298366 1,1
%A A298366 _David James Sycamore_, Jan 17 2018