MathDB
1 to n^2 numbers on n x n table , same remainder by n in diff. rows + columns

Source: Tournament of Towns, Junior A-Level , Spring 2019 p5

May 13, 2020
square gridnumbers in a tabletablecombinatorics

Problem Statement

One needs to ffll the cells of an n×nn\times n table (n>1n > 1) with distinct integers from 11 to n2n^2 so that every two consecutive integers are placed in cells that share a side, while every two integers with the same remainder if divided by nn are placed in distinct rows and distinct columns. For which nn is this possible?
(Alexandr Gribalko)