ab = vector(10 000) nw = vector(#ab) { k = -1; for (s=1, #ab, sw = 0; for (c=1, s, x = bitor(ab[c], bitor(nw[s-c+1], sw)); v = valuation(x+1, 2); if (c==s, print (k++ " " v); ); p = 2^v; sw += p; ab[c] += p; nw[s-c+1] += p; ); ); } quit