login
Sums of finite subsequences of A280708.
1

%I #20 Sep 06 2024 19:39:59

%S 0,1,8,9,24,25,32,33,48,49,56,57,86,87,94,95,110,111,118,119,134,135,

%T 142,143,1260,1261,1268,1269,1284,1285,1292,1293,1308,1309,1316,1317,

%U 1346,1347,1354,1355,1370,1371,1378,1379,1394,1395,1402,1403,1890,1891,1898

%N Sums of finite subsequences of A280708.

%H Robert Israel, <a href="/A278076/b278076.txt">Table of n, a(n) for n = 1..768</a>

%p S:= {0}: # adapted from A280708

%p x:= 1:

%p while x < 10^4 do

%p if ormap(s -> isprime(s+x), S)

%p then x:= x+1

%p else S:= S union map(`+`, S, x)

%p fi

%p od:

%p sort(convert(S,list));

%t S = {0}; x = 1;

%t While[x < 2000, If[AnyTrue[S, PrimeQ[#+x]&], x++, S = S ~Union~ (S+x)]];

%t S (* _Jean-François Alcover_, Apr 29 2019 *)

%o (SageMath)

%o def A278076(bound):

%o x, y, S = 1, 1, {0}

%o while x < bound:

%o if any(is_prime(s+x) for s in S):

%o x += 1

%o else:

%o y = x

%o S = S.union(s+x for s in S)

%o return [s for s in sorted(S) if s <= y]

%o print(A278076(10^5))

%Y Cf. A280708.

%K nonn

%O 1,3

%A _Robert Israel_ and _Peter Luschny_, Jan 20 2017