The number of triangles whose vertices are at vertices of octagon but none of whose sides happen to come from the sides of octagon
In order to get a triangle whose sides do not coincide with that of the octagon, the vertices should be alternate.
Total no. of ways of choosing 1st vertex = 8
Total no. of ways of choosing 2nd vertex = 2 , each on either side of the 1st vertex
Total no. of ways of choosing 3rd vertex = 1
Total no. of triangles = 8*2*1 = 16