cmpf(x,y) = { if (x==y, return (0), for (e=1, oo, my (d=if (x, exponent(x^e), -1)-if (y, exponent(y^e), -1)); if (d, return (-(-1)^e * d); ); ); ); } { a = vecsort([1..2^13-1], cmpf); \\ A360982 b = vector(#a); \\ inverse for (k=1, #a, b[a[k]] = k; ); print ("0 0"); for (n=1, #b, print (n " " b[n]); ); } quit