Sum of series 1 * 1 ! + 2 * 2 ! + …… . . + n * n ! | Java program to find sum of the series . ; Function to calculate required series ; Drivers code
import java . io . * ; class GFG { static int factorial ( int n ) { int res = 1 ; for ( int i = 2 ; i <= n ; i ++ ) res = res * i ; return res ; } static int calculateSeries ( int n ) { return factorial ( n + 1 ) - 1 ; } public static void main ( String [ ] args ) { int n = 3 ; System . out . println ( calculateSeries ( n ) ) ; } }