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
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Program to check if N is a Centered Octagonal Number
- Find the sum of the first N Centered Octagonal Number
- Octagonal number
- Program to check if N is a Octagonal Number
- Program to find Surface Area and Volume of Octagonal Prism
- Centered cube number
- Centered Dodecagonal Number
- Centered hexagonal number
- Program for centered nonagonal number
- Centered Octadecagonal Number
- Centered triangular number
- Centered tetrahedral number
- Centered heptagonal number
- Program for Centered Icosahedral Number
- Centered Square Number
- Centered pentagonal number
- Centered Octahedral number
- Centered decagonal number
- Centered nonadecagonal number
- Centered Pentadecagonal 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.