You should concentrate less on creating a class to represent the triangles and focus more and the keyword in the question; which is that this is a combination/permutations problem http://en.wikipedia.org/wiki/Combination
What do you know about the number of triangles in an equilateral triangle of side length n?
In what case would having k paints not be enough to satisfy the case:
In such a triangle, the contiguous stones are required not to
be painted with the same color.
How many non-contiguous triangles are there in a triangle of m triangles?