Find all positive integers such that the unit segments of an grid of unit squares can be partitioned into groups of three such that the segments of each group share a common vertex.
Solution
Answer: We first prove that is necessary for there to be such a partitioning. We break this down into proving that has to be even and that . The only way a segment on a side of the square can be part of such a T-shape is as one of the two consecutive segments along the longer side of the T-shape, so they must come in pairs and therefore, the length of each side has to be even. On the other hand, the total number of segments, which is , has to be a multiple of three as each T-shape consists of three segments, hence either or is a multiple of 3 , implying that . We can then show that these two conditions is sufficient by showing that and works and works whenever works. The construction for is simple; just put a T-shape with the longer side on each of the four sides. For and to go from to , consider the following diagram: There are two main parts - the cycle of stacks of T's in all four orientation (see the red, blue, yellow, and green stacks), and the border (seen here by the cyan, brown, and black T-shapes). The case can be considered as a special case where the middle square is a single point.