Program for centered nonagonal number | C # Program to find nth centered nonagonal number . ; Function to find nth centered nonagonal number . ; Formula to find nth centered nonagonal number . ; Driver function .
using System ; class GFG { static int centeredNonagonal ( int n ) { return ( 3 * n - 2 ) * ( 3 * n - 1 ) / 2 ; } public static void Main ( ) { int n = 10 ; Console . Write ( centeredNonagonal ( n ) ) ; } }