The problem goes as follow:
Let $n$ be a positive integer relatively prime to 6. We paint the vertices of a regular $n$-gon with three colours so that there is an odd number of vertices of each colour. Show that there exists an isosceles triangle whose three vertices are of different colours.
The proof I've been reading comes from the OTIS excerpts and it first uses the fact that $\gcd(n,6) = 1$ to say that there's no equilateral triangles but I don't see how this is the case, I would appreciate if someone explained this further. And next it uses this to say that because of this each edge of the $n$-gon is used in exactly three isoceles triangles. I can see how each side is used as a leg of one isoceles triangle but not how as a base of one, and a bit less how is that it's the base of just one triangle.
Next it assumes for contradiction that there's no such triangle as in the statement and defines $Y$ and $X$ as the number of monochromatic trangles on the $n$-gon and the rest of those triangles respectively. Now by letting $a,b$ and $c$ be the numbers of vertices of each colour it states that $X+3Y = 3(\binom a2 + \binom b2 + \binom c2)$ and I don't understand where this comes from so I would apreciate if someone could explain this further because I've been stuck for a bit. I understand the rest of the proof but I don't really see how these two steps are justified.