login
A370998
2*a(n) = m is the least even number m such that all sums m + prime(k), k=1..n are composite.
3
1, 3, 11, 44, 44, 56, 56, 101, 101, 101, 359, 359, 359, 664, 664, 821, 821, 821, 866, 866, 866, 2623, 2623, 2623, 2623, 2944, 2944, 2944, 2944, 2944, 2944, 2944, 2944, 2944, 5171, 5171, 12839, 18833, 18833, 18833, 18833, 29947, 29947, 29947, 38002, 38002, 38002, 38002, 51551
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
Cf. A239392 (records).
Sequence in context: A107290 A302333 A345670 * A239392 A122393 A012880
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Mar 09 2024
STATUS
approved