Centered Octadecagonal Number | C # Program to find the nth centered octadecagonal number ; centered octadecagon function ; Formula to calculate nth centered octadecagonal number ; Driver Code
using System ; class GFG { static int center_octadecagon_num ( int n ) { return 9 * n * n - 9 * n + 1 ; } static public void Main ( ) { int n = 3 ; Console . Write ( n + " th ▁ centered ▁ " + " octadecagonal ▁ number ▁ : ▁ " ) ; Console . WriteLine ( center_octadecagon_num ( n ) ) ; n = 13 ; Console . Write ( n + " th ▁ centered ▁ " + " octadecagonal ▁ number ▁ : ▁ " ) ; Console . WriteLine ( center_octadecagon_num ( n ) ) ; } }