Sum of series 1 * 1 * 2 ! + 2 * 2 * 3 ! + …… . . + n * n * ( n + 1 ) ! | Python program to find sum of the series . ; Function to calculate required series ; Driver code
import math NEW_LINE def factorial ( n ) : NEW_LINE INDENT res = 1 NEW_LINE i = 2 NEW_LINE for i in ( n + 1 ) : NEW_LINE INDENT res = res * i NEW_LINE DEDENT return res NEW_LINE DEDENT def calculateSeries ( n ) : NEW_LINE INDENT return ( 2 + ( n * n + n - 2 ) * math . factorial ( n + 1 ) ) NEW_LINE DEDENT n = 3 NEW_LINE print ( calculateSeries ( n ) ) NEW_LINE