OFFSET
1,2
COMMENTS
Conjecture: 25 is the largest odd term of this sequence.
Essentially the same as A025044. - R. J. Mathar, Sep 30 2008
LINKS
Ray Chandler, Table of n, a(n) for n = 1..10000
EXAMPLE
a(2) = 8 as for the smaller composite numbers 4 and 6 one gets 4 + 1 = 5 and 6 + 1 = 7, both primes. a(3) = 14 as 1 + 14 = 15 and 8 + 14 = 22 are composite.
MATHEMATICA
a1 = {0}; nmax = 266; Do[ If[Select[n + a1, PrimeQ] == {}, AppendTo[a1, n]] , {n, nmax}]; Rest[a1] (* Ray Chandler, Jan 15 2017 *)
PROG
(Python)
from sympy import isprime
from itertools import islice
def agen(start=1): # generator of terms
alst, k, sums = [0, start], 2, {0} | {start}
while True:
yield alst[-1]
while any(isprime(k+an) for an in alst): k += 1
alst.append(k)
k += 1
print(list(islice(agen(), 60))) # Michael S. Branicky, Dec 15 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, Feb 27 2002
EXTENSIONS
More terms from Sascha Kurz, Mar 17 2002
Description clarified by Ray Chandler, Jan 15 2017
STATUS
approved