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.

A133660 No sum of 2 or more terms equals a prime.

This page as a plain text file.
%I A133660 #16 Jun 17 2018 11:48:08
%S A133660 1,3,5,87,113,1151,5371,199276,32281747,16946784207
%N A133660 No sum of 2 or more terms equals a prime.
%C A133660 Sequence is infinite since the primes have density 0. - _Charles R Greathouse IV_, Apr 28 2011
%e A133660 5 is a term of the series, as 5+1, 5+3 and 5+3+1 are all nonprime. The next term, 87, is the next number k such that k+1, k+3, k+1+3, k+5, k+1+5, k+3+5 and k+1+3+5 are all nonprime.
%t A133660 (* first do *) Needs["Combinatorica`"] (* then *) lst = {}; g[k_] := Block[{j = 1, l = 2^Length@lst}, While[j < l && !PrimeQ[Plus @@ NthSubset[j, lst] + k], j++ ]; If[j == l, False, True]]; f[n_] := Block[{k = lst[[ -1]] + 1}, While[g[k] == True, k++ ]; AppendTo[lst, k]; k]; Do[Print@f@n, {n, 10}]; (* _Robert G. Wilson v_, Dec 31 2007 *)
%t A133660 (* Second program, avoids "Combinatorica`": *)
%t A133660 Nest[Append[#, Block[{k = Last@ # + 1}, While[AnyTrue[Total /@ Select[Subsets[Append[#, k]], Length@ # > 1 &], PrimeQ],k++ ]; k ] ] &, {1}, 6] (* _Michael De Vlieger_, Jun 11 2018 *)
%Y A133660 Cf. A052349, A133661.
%K A133660 more,nonn
%O A133660 1,2
%A A133660 _Randy L. Ekl_, Dec 28 2007
%E A133660 a(9) from _Robert G. Wilson v_, Dec 31 2007
%E A133660 a(10) from _Donovan Johnson_, Feb 15 2008