graycode(n) = gracode(n - 1) + (gracode(n - 1) + 1<<(n-1))