# Heptagonal number

A heptagonal number is a figurate number that represents a heptagon. The n-th heptagonal number is given by the formula

$\frac{5n^2 - 3n}{2}$.
The first five heptagonal numbers.

The first few heptagonal numbers are:

1, 7, 18, 34, 55, 81, 112, 148, 189, 235, 286, 342, 403, 469, 540, 616, 697, 783, 874, 970, 1071, 1177, 1288, 1404, 1525, 1651, 1782, … (sequence A000566 in OEIS)

## Parity

The parity of heptagonal numbers follows the pattern odd-odd-even-even. Like square numbers, the digital root in base 10 of a heptagonal number can only be 1, 4, 7 or 9. Five times a heptagonal number, plus 1 equals a triangular number.

## Generalized heptagonal numbers

A generalized heptagonal number is obtained by the formula

$T_n + T_{\lfloor \frac{n}{2} \rfloor},$

where Tn is the nth triangular number. The first few generalized heptagonal numbers are:

1, 4, 7, 13, 18, 27, 34, 46, 55, 70, 81, 99, 112, … (sequence A085787 in OEIS)

Every other generalized heptagonal number is a regular heptagonal number. Besides 1 and 70, no generalized heptagonal numbers are also Pell numbers.[1]

## Sum of reciprocals

A formula for the sum of the reciprocals of the heptagonal numbers is given by:[2]

$\sum_{n=1}^\infty \frac{2}{n(5n-3)} = \frac{1}{15}{\pi}{\sqrt{25-10\sqrt{5}}}+\frac{2}{3}\ln(5)+\frac{{1}+\sqrt{5}}{3}\ln\left(\frac{1}{2}\sqrt{10-2\sqrt{5}}\right)+\frac{{1}-\sqrt{5}}{3}\ln\left(\frac{1}{2}\sqrt{10+2\sqrt{5}}\right)$

## References

1. ^ B. Srinivasa Rao, "Heptagonal Numbers in the Pell Sequence and Diophantine equations $2x^2 = y^2(5y - 3)^2 \pm 2$" Fib. Quart. 43 3: 194
2. ^ Beyond the Basel Problem: Sums of Reciprocals of Figurate Numbers