Solution:
We approach the problem by finding the minimum number of triangles with a pair of edges of the same color; we call such triangles "isosceles". We can count the number of such triangles by instead considering:
The number of isosceles triangles is equal to the number of pairs of adjacent edges of the same color.
So, if we let ni,v denote the number of edges of the ith color touching vertex v, the number of isosceles triangles can be written as
v vertex∑i=1∑8(ni,v2)
Since ∑i=18ni,v=16, by Jensen's Inequality we actually have
v vertex∑i=1∑8(ni,v2)≥v vertex∑8(16/82)=17⋅8=136
So, the number of triangles with all different colors is at most (173)−17⋅8=544. We leave the construction of a maximal example as an exercise to the reader.