OFFSET
1,2
EXAMPLE
a(1) = 1: prime(1) = 2; 2 + 2*a(1) = 4 is the first composite.
a(2) = 3: m = 6; since all sums prime(1) + 2*x are even, any x can be chosen. prime(2) = 3, 3 + 6 = 9, whereas 3 + 1*2 and 3 + 2*2 are prime.
a(3) = 11: m = 22; for any even m < 22 at least one of 3 + m or 5 + m would be prime, e.g., 3+2=5, 3+4=7, 5+6=11, 3+8=11, 5+12=17, 5+14=19, 3+16=19, 5+18=23, 3+20=23, but 3+22=25 and 5+22 are composite.
PROG
(Python)
from itertools import count
from sympy import prime, isprime
def A370998(n):
ptuple = tuple(prime(k) for k in range(1, n+1))
return next(filter(lambda m:not any(isprime(p+m) for p in ptuple), count(2, 2)))>>1 # Chai Wah Wu, Mar 21 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Mar 09 2024
STATUS
approved