Centered Hexadecagonal Number | C # Program to find nth centered hexadecagonal number ; centered hexadecagonal function ; Formula to calculate nth centered hexadecagonal number ; Driver Code
using System ; class GFG { static int center_hexadecagonal_num ( int n ) { return 8 * n * n - 8 * n + 1 ; } static public void Main ( ) { int n = 2 ; Console . Write ( n + " th ▁ centered ▁ " + " hexadecagonal ▁ number : ▁ " ) ; Console . WriteLine ( center_hexadecagonal_num ( n ) ) ; n = 12 ; Console . Write ( n + " th ▁ centered ▁ " + " hexadecagonal ▁ number : ▁ " ) ; Console . WriteLine ( center_hexadecagonal_num ( n ) ) ; } }