第 403 题:(2017 AIME II, 13)
For each integer $n\geq3$, 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$.
- Each vertex is the apex of $\left\lfloor\frac{n-1}2\right\rfloor$ isosceles triangles, and an equilateral triangle (when $3\mid n$) is counted three times. So $f(n)=n\bigl\lfloor\frac{n-1}2\bigr\rfloor-\frac{2n}3[3\mid n]$.
- Solving $f(n+1)-f(n)=78$ in each residue class of $n$ mod $6$ gives $n=36,52,157$.
- The sum is $245$. The answer is $\boxed{245}$.
For each integer $n\geq3$, 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)+66$.