Find Nth term of the series 1 , 8 , 54 , 384. . . | Java program to find N - th term of the series : 1 , 8 , 54 , 384. . . ; Main class for main method ; Calculate factorial of N ; By using above formula
import java . io . * ; class GFG { public static int fact ( int N ) { int i , product = 1 ; for ( i = 1 ; i <= N ; i ++ ) product = product * i ; return product ; } public static int nthTerm ( int N ) { return ( N * N ) * fact ( N ) ; } public static void main ( String [ ] args ) { System . out . println ( nthTerm ( N ) ) ; } }