login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(1) = 1, a(n) = smallest distinct composite number such that a(n) + a(k) is a composite number for all k = 1 to n.
6

%I #17 Dec 15 2022 09:59:59

%S 1,8,14,20,24,25,26,32,38,44,50,56,62,68,74,80,86,90,92,94,98,104,110,

%T 116,118,120,122,128,134,140,144,146,152,158,160,164,170,176,182,184,

%U 188,194,200,206,212,218,220,224,230,234,236,242,248,254,260,264,266

%N a(1) = 1, a(n) = smallest distinct composite number such that a(n) + a(k) is a composite number for all k = 1 to n.

%C Conjecture: 25 is the largest odd term of this sequence.

%C Essentially the same as A025044. - _R. J. Mathar_, Sep 30 2008

%H Ray Chandler, <a href="/A068638/b068638.txt">Table of n, a(n) for n = 1..10000</a>

%e 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.

%t a1 = {0}; nmax = 266; Do[ If[Select[n + a1, PrimeQ] == {}, AppendTo[a1, n]] , {n, nmax}]; Rest[a1] (* _Ray Chandler_, Jan 15 2017 *)

%o (Python)

%o from sympy import isprime

%o from itertools import islice

%o def agen(start=1): # generator of terms

%o alst, k, sums = [0, start], 2, {0} | {start}

%o while True:

%o yield alst[-1]

%o while any(isprime(k+an) for an in alst): k += 1

%o alst.append(k)

%o k += 1

%o print(list(islice(agen(), 60))) # _Michael S. Branicky_, Dec 15 2022

%Y Cf. A025044.

%K easy,nonn

%O 1,2

%A _Amarnath Murthy_, Feb 27 2002

%E More terms from _Sascha Kurz_, Mar 17 2002

%E Description clarified by _Ray Chandler_, Jan 15 2017