2017 AIME II Problem 13

For each integer n \geq 3, let f(n) be the number of 3 -element subsets of the vertices of a regular n-gon that are the vertices of an isosceles triangle (including equilateral triangles). Find the sum of all values of n such that f(n+1)=f(n)+78.