Find the sum of the first Nth Centered Tridecagonal Numbers | Function to calculate the N - th Centered tridecagonal number ; Formula to calculate Nth Centered tridecagonal number & return it ; Function to find the sum of the first N Centered tridecagonal numbers ; Variable to store the sum ; Loop to iterate and find the sum of first N Centered tridecagonal numbers ; Driver Code
def Centered_tridecagonal_num ( n ) : NEW_LINE INDENT return ( 13 * n * ( n - 1 ) + 2 ) // 2 NEW_LINE DEDENT def sum_Centered_tridecagonal_num ( n ) : NEW_LINE INDENT summ = 0 NEW_LINE for i in range ( 1 , n + 1 ) : NEW_LINE INDENT summ += Centered_tridecagonal_num ( i ) NEW_LINE DEDENT return summ NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT n = 5 NEW_LINE print ( sum_Centered_tridecagonal_num ( n ) ) NEW_LINE DEDENT