\\ A048720 T(n,k) = { my (v=0, e); while (k, k-=2^e=valuation(k, 2); v=bitxor(v, n*2^e); ); v } vv = vector(2^10, n, []) { for (n=1, #vv, for (k=1, oo, v = T(n,k); if (v>#vv, break, vv[v]=concat(vv[v], n)); ); ); } apply (v -> print (n++ " " v), concat(vv)); quit