let f(x) = the number of diagonals in a x-gon polygon

find f(10000)

The answer is 49985000.

**
This section requires Javascript.
**

You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.

Let us consider one individual vertex. A diagonal is a line formed when that vertex and another point are joined. However, if a point is directly adjacent to it, the line formed will not be a diagonal (it will be an edge). Also, it is obvious that the point itself cannot be chosen (no line formed). Therefore a vertex will be formed between that vertex, and all but three (one on each side and the point itself) of the other vertices. This is true for all the vertices. Thus,

$f(x)=x(x-3)$ (so far)

However, connecting vertices A and B forms the same diagonal as connecting B and A. We are therefore counting each individual diagonals as two distinct diagonals, which is not true, so we must divide by 2. Therefore our function becomes

$f(x)=1/2*x(x-3)$

and finally,

$f(10,000)=49985000$