PUMaC 2009 Combinatrics A Problem 5

There are n players in a round-robin ping-pong tournament (i.e. every two persons will play exactly one game). After some matches have been played, it is known that the total number of matches that have been played among any n-2 people is equal to 3^{k} (where k is a fixed integer). Find the sum of all possible values of n.