Centered nonadecagonal number | C ++ Program to find nth centered nonadecagonal number ; centered nonadecagonal function ; Formula to calculate nth centered nonadecagonal number ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int center_nonadecagon_num ( long int n ) { return ( 19 * n * n - 19 * n + 2 ) / 2 ; } int main ( ) { long int n = 2 ; cout << n << " th ▁ centered ▁ nonadecagonal ▁ number ▁ : ▁ " << center_nonadecagon_num ( n ) ; cout << endl ; n = 7 ; cout << n << " th ▁ centered ▁ nonadecagonal ▁ number ▁ : ▁ " << center_nonadecagon_num ( n ) ; return 0 ; }