Find Nth term of series 1 , 4 , 15 , 72 , 420. . . | Function to find factorial of N ; Base condition ; Use recursion ; Calculate Nth term of series ; Driver Code
function factorial ( N ) { if ( N == 0 N == 1 ) return 1 ; return N * factorial ( N - 1 ) ; } function nthTerm ( N ) { return ( factorial ( N ) * ( N + 2 ) / 2 ) ; } let N = 6 ; document . write ( nthTerm ( N ) ) ;