Centered tridecagonal number | C ++ Program to find nth centered tridecagonal number ; Function to find nth centered tridecagonal number ; Formula to calculate nth centered tridecagonal number ; Drivers code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int centeredTridecagonalNum ( long int n ) { return ( 13 * n * ( n - 1 ) + 2 ) / 2 ; } int main ( ) { long int n = 3 ; cout << centeredTridecagonalNum ( n ) ; cout << endl ; n = 10 ; cout << centeredTridecagonalNum ( n ) ; return 0 ; }