cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A278076 Sums of finite subsequences of A280708.

This page as a plain text file.
%I A278076 #20 Sep 06 2024 19:39:59
%S A278076 0,1,8,9,24,25,32,33,48,49,56,57,86,87,94,95,110,111,118,119,134,135,
%T A278076 142,143,1260,1261,1268,1269,1284,1285,1292,1293,1308,1309,1316,1317,
%U A278076 1346,1347,1354,1355,1370,1371,1378,1379,1394,1395,1402,1403,1890,1891,1898
%N A278076 Sums of finite subsequences of A280708.
%H A278076 Robert Israel, <a href="/A278076/b278076.txt">Table of n, a(n) for n = 1..768</a>
%p A278076 S:= {0}:  # adapted from A280708
%p A278076 x:= 1:
%p A278076 while x < 10^4 do
%p A278076   if ormap(s -> isprime(s+x), S)
%p A278076      then x:= x+1
%p A278076      else S:= S union map(`+`, S, x)
%p A278076   fi
%p A278076 od:
%p A278076 sort(convert(S,list));
%t A278076 S = {0}; x = 1;
%t A278076 While[x < 2000, If[AnyTrue[S, PrimeQ[#+x]&], x++, S = S ~Union~ (S+x)]];
%t A278076 S (* _Jean-François Alcover_, Apr 29 2019 *)
%o A278076 (SageMath)
%o A278076 def A278076(bound):
%o A278076     x, y, S = 1, 1, {0}
%o A278076     while x < bound:
%o A278076         if any(is_prime(s+x) for s in S):
%o A278076             x += 1
%o A278076         else:
%o A278076             y = x
%o A278076             S = S.union(s+x for s in S)
%o A278076     return [s for s in sorted(S) if s <= y]
%o A278076 print(A278076(10^5))
%Y A278076 Cf. A280708.
%K A278076 nonn
%O A278076 1,3
%A A278076 _Robert Israel_ and _Peter Luschny_, Jan 20 2017