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 pentagonal number
- Centered Octahedral number
- Centered cube number
- Centered triangular number
- Centered Octadecagonal Number
- Centered tetrahedral number
- Centered heptagonal number
- Centered Square Number
- Centered Dodecagonal Number
- Centered Pentadecagonal Number
- Centered hexagonal number
- Centered tridecagonal number
- Centered dodecahedral 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 email@example.com. 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.