IMO 2007 Shortlist C3

Find all positive integers n, for which the numbers in the set S = {1,2,...,n} can be colored red and blue, with the fol...

IMO 2007 Shortlist C3

Category: Combinatorics

Problem

Find all positive integers n, for which the numbers in the set S = {1,2,...,n} can be colored red and blue, with the following condition being satisfied: the set S × S × S contains exactly 2007 ordered triples (x,y,z) such that (i) x,y,z are of the same color and (ii) x+y +z is divisible by n. (Netherlands)