Hexadecagonal number | C # program to find Nth hexadecagon number ; Function to calculate hexadecagonal number ; Drivers Code
using System ; class GFG { static long hexadecagonalNum ( long n ) { return ( ( 14 * n * n ) - 12 * n ) / 2 ; } public static void Main ( ) { long n = 5 ; Console . WriteLine ( n + " th ▁ " + " Hexadecagonal ▁ number ▁ : ▁ " + hexadecagonalNum ( n ) ) ; n = 9 ; Console . WriteLine ( n + " th ▁ " + " Hexadecagonal ▁ number ▁ : ▁ " + hexadecagonalNum ( n ) ) ; } }