{ for (n = 1, #a = vector(10 000), x = 2^0; for (w = 1, oo, if (n-2*w < 1, break, u = a[n-2*w]; v = a[n-w]; if (u >= v, d = v-u; c = v + d; if (c > 0, x = bitor(x, 2^c); ); ); ); ); print (n " " a[n] = valuation(x+1, 2)); ); } quit