Two way 2d hilbert curve mapping for a square divided into n by n cells, for n a power of 2, with integer coordinates