Program for centered nonagonal number | Function to find nth centered nonagonal number . ; Formula to find nth centered nonagonal number . ; Driver function .
function centeredNonagonal ( n ) { return parseInt ( ( 3 * n - 2 ) * ( 3 * n - 1 ) / 2 ) ; } let n = 10 ; document . write ( centeredNonagonal ( n ) ) ;