A383969 a(n) is the smallest even number m such that the set {m+1, m+3, m+5, ..., m+(2*n-1)} contains no prime numbers.
0, 24, 90, 114, 114, 114, 524, 524, 888, 1130, 1328, 1328, 1328, 1328, 1328, 1328, 9552, 15684, 15684, 15684, 15684, 19610, 19610, 19610, 19610, 31398, 31398, 31398, 31398, 31398, 31398, 31398, 31398, 31398, 31398, 155922, 155922, 155922, 155922, 155922, 155922, 155922
Offset: 1
Keywords
Examples
a(1) = 0 since 0 is the smallest even number such that 0 + 1 = 1 is not prime a(2) = 24 since there are no primes in {24+1, 24+3} = {25, 27} and no smaller even number has this property. a(3) = 90 since there are no primes in {91, 93, 95}, and no smaller even number has this property.
Programs
-
Mathematica
k = 0; Table[While[AnyTrue[k + Range[2*n - 1], PrimeQ], k += 2]; k, {n, 42}] (* Michael De Vlieger, Jun 01 2025 *)
-
Python
from sympy import isprime from itertools import count def a(n): return next(m for m in count(0, 2) if all(not isprime(m+2*i+1) for i in range(n))) print([a(n) for n in range(1, 43)]) # Michael S. Branicky, May 23 2025
Extensions
a(4) and beyond from Michael S. Branicky, May 23 2025
Comments