# How many of the triangles in a regular polygon of 18 sides are isosceles but not equilateral?

Let $A_1,A_2,.....,A_{18}$ be the vertices of a regular polygon with $18$ sides. How many of the triangles $\Delta A_iA_jA_k,1\le i<j<k\le 18$, are isosceles but not equilateral?

A. $63$

B. $70$

C. $126$

D. $144$

I attempted to use the following result:

$$\#\text{isosceles} = \begin{cases} n^2/2 - (5/3) n & \text{for } n\equiv 0 \pmod 6 \\ n^2/2 - (1/2) n & \text{for } n\equiv 1, 5 \pmod 6 \\ n^2/2 - n & \text{for } n\equiv 2, 4 \pmod 6 \\ n^2/2 - (7/6) n & \text{for } n\equiv 3 \pmod 6 \end{cases}$$

But using this I end up with:

$\dfrac{18^2}{2}-\dfrac{5}{3}\cdot 18=132$

There are $18$ ways to choose the apex of the triangle. If the apex is at vertex $0$ the two other vertices can be at one of the pairs $\pm1$, $\ldots$, $\pm5$, $\pm7$, $\pm8$. As a consequence there are $18\cdot7=126$ possibilities in all.