# Closed Form for Heptagonal Numbers

## Theorem

The closed-form expression for the $n$th heptagonal number is:

$H_n = \dfrac {n \paren {5 n - 3} } 2$

## Proof

Heptagonal numbers are $k$-gonal numbers where $k = 7$.

From Closed Form for Polygonal Numbers we have that:

$\map P {k, n} = \dfrac n 2 \paren {\paren {k - 2} n - k + 4}$

Hence:

 $\ds H_n$ $=$ $\ds \frac n 2 \paren {\paren {7 - 2} n - 7 + 4}$ Closed Form for Polygonal Numbers $\ds$ $=$ $\ds \dfrac {n \paren {5 n - 3} } 2$

Hence the result.

$\blacksquare$