Given a number n, find the nth centered octagonal number.
A centered octagonal number represents an octagon with a dot in the centre and others dots surrounding the centre dot in the successive octagonal layer.
Input : 2 Output : 9 Input : 5 Output : 81
Centered Octagonal n-th Number is given by :
Basic Implementation of the above approach:
6th centered octagonal number : 121 11th centered octagonal number : 441
- Octagonal number
- Centered decagonal number
- Centered dodecahedral number
- Centered hexagonal number
- Centered cube number
- Centered Pentadecagonal Number
- Centered tetrahedral number
- Centered heptagonal number
- Centered Square Number
- Centered nonadecagonal number
- Centered Hexadecagonal Number
- Centered triangular number
- Centered Octahedral number
- Centered pentagonal number
- Centered tridecagonal 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.