Closed Form for Octagonal Numbers

Theorem
The closed-form expression for the $n$th octagonal number is:
 * $O_n = n \left({3 n - 2}\right)$

Proof
Octagonal numbers are $k$-gonal numbers where $k = 8$.

From Closed Form for Polygonal Numbers we have that:
 * $P \left({k, n}\right) = \dfrac n 2 \left({\left({k - 2}\right) n - k + 4}\right)$

Hence:

Hence the result.