Divide by 4 and round up to get the row number.

If the number is odd, then the numbers go from left to right eg. 1 2 3 4, so the remainder when you divided by 4 is the column number.

If the number is even then they go right to left so 4 - the remainder is the column number