Given a number n, the task is to find nth Centered heptagonal number.
Centered heptagonal number is centered figure number that represents a heptagon with dot in center and all other dot surrounding in heptagonal form. Nth centered heptagonal number can be calculated by using formula (7n2 – 7n + 2) / 2.
Input : n = 2 Output : 8 Input : n = 7 Output : 148
Please refer this diagram for pictorial representation.
Below is the implementation :
5th Centered heptagonal number : 71
- Heptagonal number
- Centered tridecagonal number
- Centered Hexadecagonal Number
- Centered Octadecagonal Number
- Centered cube number
- Centered tetrahedral number
- Centered Square Number
- Centered Octahedral number
- Centered triangular number
- Centered pentagonal number
- Centered Octagonal Number
- Centered nonadecagonal number
- Centered Pentadecagonal Number
- Centered hexagonal number
- Centered dodecahedral number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.