Problem

Source: Iran MO 3rd round 2016 finals -Combinatorics P3

Tags: modular arithmetic, combinatorics, table, Coloring



A $30\times30$ table is given. We want to color some of it's unit squares such that any colored square has at most $k$ neighbors. ( Two squares $(i,j)$ and $(x,y)$ are called neighbors if $i-x,j-y\equiv0,-1,1 \pmod {30}$ and $(i,j)\neq(x,y)$. Therefore, each square has exactly $8$ neighbors) What is the maximum possible number of colored squares if$:$ $a) k=6$ $b)k=1$