Centered nonadecagonal number | C # Program to find nth centered nonadecagonal number ; centered nonadecagonal function ; Formula to calculate nth centered nonadecagonal number ; Driver code
using System ; class GFG { static int center_nonadecagon_num ( int n ) { return ( 19 * n * n - 19 * n + 2 ) / 2 ; } static public void Main ( ) { int n = 2 ; Console . Write ( n + " th ▁ centered ▁ " + " nonadecagonal ▁ number ▁ : ▁ " ) ; Console . WriteLine ( center_nonadecagon_num ( n ) ) ; n = 7 ; Console . Write ( n + " th ▁ centered ▁ " + " nonadecagonal ▁ number ▁ : ▁ " ) ; Console . WriteLine ( center_nonadecagon_num ( n ) ) ; } }