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 heptagonal number
- Centered tridecagonal number
- Centered Square Number
- Centered Octadecagonal Number
- Centered pentagonal number
- Centered Dodecagonal Number
- Centered cube number
- Centered Octahedral number
- Centered Pentadecagonal Number
- Centered hexagonal number
- Centered decagonal 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 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.