OFFSET
1,1
COMMENTS
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).
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.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..7000
FORMULA
EXAMPLE
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.
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 *)
PROG
(Magma) [2*n: n in [8..200] | not IsPrime(2*n-5) and not IsPrime(2*n-3)]; // Vincenzo Librandi, Nov 16 2018
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Jan 17 2018
STATUS
approved