T = vector(987) n = 0 m = 0 emit(t) = { if (n++ <= #T, T[n] = t; ); apply (v -> print (m++ " " v + 2^exponent(m)), t); } { print (m++ " " 1); emit([0, 1]); for (k = 1, #T, my (t = T[k]); if (#t > 1, emit(2*t[2..#t]); ); emit(concat( [2*t[1]+0, 2*t[1]+1], [2*v+1 | v <- t[2..#t]] )); ); } quit