OFFSET
0,2
COMMENTS
This sequence starts at a(0)=1, subsequent terms a(n) for n>0 being obtained by selecting the (greatest Ulam number) <= 1+Sum_{i=0..n-1} a(i). This ensures that the sequence is complete because Sum_{i=0..n-1} a(i) >= a(n)-1, for all n>=0 and a(0)=1, is a necessary and sufficient condition for completeness.
LINKS
Wikipedia, Ulam number.
FORMULA
a(n) = (greatest Ulam number) <= 1+Sum_{i=0..n-1} a(i), with a(0) = 1.
EXAMPLE
Given that the first 7 terms of the sequence are 1, 2, ..., 28, 57 then a(7)=(greatest Ulam number) <= (1+2+...+28, 57) + 1 = 117, hence a(7)=114.
MATHEMATICA
lst1 = Last/@ReadList["https://oeis.org/A002858/b002858.txt", {Number, Number}]; lst={1, 2}; n=3; Do[s=Total@lst; While[s+1>=lst1[[n]], n++]; AppendTo[lst, lst1[[n-1]]], 16]; lst
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Frank M Jackson, Oct 17 2021
EXTENSIONS
a(18)-a(30) from Amiram Eldar, Oct 17 2021
STATUS
approved