login
A331811
a(n) is the next number after a(n-1) which cannot be represented in the form 2*a(i) and Sum_{j=1..n-1} b_j*a(j) where 0 < i < n, b_j = 1 or 0. The sequence starts: a(1) = 1; a(2) = 2; a(3) = 3; a(4) = 5.
3
1, 2, 3, 5, 12, 25, 49, 73, 171, 195, 512, 658, 1560, 1950, 4826, 6142, 14868, 18768, 45920, 58204, 141660, 179196, 437264, 553672, 1349328, 1707720, 4164392, 5271736, 12851568, 16267008, 39662048, 50205520, 122401584, 154935600, 377748224, 478159264, 1165778688, 1475649888
OFFSET
1,2
COMMENTS
This sequence is a complete sequence.
LINKS
Eric Weisstein's World of Mathematics, Complete Sequence
MATHEMATICA
Nest[Append[#, Block[{k = #[[-1]] + 1}, While[Nand[NoneTrue[#, k == 2 # &], FreeQ[Map[Total, Rest@ Subsets[#]], k]], k++]; k]] & @@ {#, Map[Total, Subsets[#]]} &, {1, 2, 3, 5}, 10] (* Michael De Vlieger, Jan 27 2020 *)
PROG
(PARI) upto(lim)={my(a=[1, 2, 3, 5], b=[]); for(i=1, lim, forsubset(#a, x, b=concat(b, [vecsum(vecextract(a, x))])); b=setminus(vecsort(b, , 8), a); for(j=1, #a, b=concat(b, [2*a[j]]); b=vecsort(b, , 8)); if(setsearch(b, i)==0, a=concat(a, [i]); a=vecsort(a, , 8)) ); a}
{ upto(200) }
CROSSREFS
(C++) See Links section.
Sequence in context: A003428 A191626 A030041 * A284910 A233231 A319912
KEYWORD
nonn
AUTHOR
EXTENSIONS
a(13)-a(14) from Hugo Pfoertner, Jan 27 2020
More terms from Rémy Sigrist, Jan 28 2020
STATUS
approved