Problem

Source: Moscow Math Olympiad 2017, Grade 11, P11

Tags: combinatorics, number theory



There is one nonzero digit in every cell of $2017\times 2017 $ table. On the board we writes $4034$ numbers that are rows and columns of table. It is known, that $4033$ numbers are divisible by prime $p$ and last is not divisible by $p$. Find all possible values of $p$.

HIDE: Example Example for $2\times2$. If table is |1|4| |3|7|. Then numbers on board are $14,37,13,47$