Find the sum of the first Nth Centered Pentadecagonal Number | Function to find the centered pentadecagonal number ; Formula to calculate N - th centered pentadecagonal number ; Function to find the sum of the first N centered pentadecagonal numbers ; Variable to store the sum ; Driver Code
function Centered_Pentadecagonal_num ( n ) { return ( 15 * n * n - 15 * n + 2 ) / 2 ; } function sum_Centered_Pentadecagonal_num ( n ) { let summ = 0 ; for ( let i = 1 ; i < n + 1 ; i ++ ) { summ += Centered_Pentadecagonal_num ( i ) ; } return summ ; } let n = 5 ; document . write ( sum_Centered_Pentadecagonal_num ( n ) ) ;