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