The number of triangles that can be formed with vertices of an octagon is given by choosing 3 vertices from 8. The total number of triangles is:
8C3 = 8 × 7 × 6 / 3 × 2 × 1 = 56.
However, the triangles with one side common with the octagon must include two adjacent vertices. There are 8 sides in the octagon, so there are 8 such triangles.
The total number of triangles with one side common with the octagon is: 56 −53 =3