TITLE: Triangles defined on an infinite Go board by same-colored stones
QUESTION [18 upvotes]: You start with an infinite Go board. On every point of the board you place one colored stone. There are $n>1$ different colors. Find all natural numbers $n$ that no matter how the stones are colored, three stones of the same color form the vertices of a right-angled triangle. The catheti (legs) of the right triangle must be on the lines of the board.  

Any ideas how to solve this kind of problem and to which area of mathematics this question belongs?

REPLY [10 votes]: Call a stone h-unique if no other stone on the same row has the same colour, call it v-unique if no other stone on the same column has the same colour.
Clearly, every row contains at most $n-1$ h-unique stones and every column at most $n-1$ v-unique stones. Hence in a rectangle of $n$ rows and $n^2-n+1$ columns, there are at most $n^2-n$ h-unique stones. Hence there is a column of this rectangle that does not have a h-unique stone. One stone in this column is not v-unique. This stone, plus a stone witnessing its non-h-uniqeness, plus a stone witnessing its non-v-uniqueness, form a right triangle of same-colour stones as desired.