Find the sum of the first N Centered Dodecagonal Number | Function to find the N - th Centered Dodecagonal number ; Formula to calculate nth Centered_Dodecagonal number ; Function to find the sum of the first N Centered_Dodecagonal number ; Variable to store the sum ; Iterating from 1 to N ; Finding the sum ; Driver code
def Centered_Dodecagonal_num ( n ) : NEW_LINE INDENT return 6 * n * ( n - 1 ) + 1 NEW_LINE DEDENT def sum_Centered_Dodecagonal_num ( n ) : NEW_LINE INDENT summ = 0 NEW_LINE for i in range ( 1 , n + 1 ) : NEW_LINE INDENT summ += Centered_Dodecagonal_num ( i ) NEW_LINE DEDENT return summ NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT n = 5 NEW_LINE print ( sum_Centered_Dodecagonal_num ( n ) ) NEW_LINE DEDENT