Find the sum of the first N Dodecagonal Numbers | Function to find the N - th dodecagonal number ; Formula to calculate N - th dodecagonal number ; Function to find the sum of the first N dodecagonal numbers ; Variable to get the sum ; Iterating through the first N numbers ; Compute the sum ; Driver Code ; Display first Nth centered_decagonal number
function Dodecagonal_num ( n ) { return ( 5 * n * n - 4 * n ) ; } function sum_Dodecagonal_num ( n ) { let summ = 0 ; for ( let i = 1 ; i < n + 1 ; i ++ ) { summ += Dodecagonal_num ( i ) ; } return summ ; } let n = 5 ; document . write ( sum_Dodecagonal_num ( n ) ) ;