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 decagonal number
- Centered Octahedral number
- Centered pentagonal number
- Centered cube number
- Centered hexagonal number
- Centered tridecagonal number
- Centered tetrahedral number
- Centered nonadecagonal number
- Centered Square Number
- Centered Dodecagonal Number
- Centered Octadecagonal Number
- Centered triangular number
- Centered Octagonal Number
- Centered Hexadecagonal 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.