Triacontagon Number | C ++ program for above approach ; Finding the nth triacontagonal number ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int triacontagonalNum ( int n ) { return ( 28 * n * n - 26 * n ) / 2 ; } int main ( ) { int n = 3 ; cout << "3rd ▁ triacontagonal ▁ Number ▁ is ▁ = ▁ " << triacontagonalNum ( n ) ; return 0 ; }