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