p:printf;n:?read();p(?t,"Gray code n=~d ",n);sum(p(?t,"~v,'0b ",n,?logxor(i,fix(i/2))),i,0,2^n-1);