Find Nth term of series 1 , 4 , 15 , 72 , 420. . . | Function to find factorial of N ; return factorial of N ; calculate Nth term of series ; Driver code
function factorial ( N ) { let fact = 1 ; for ( let i = 1 ; i <= N ; i ++ ) fact = fact * i ; return fact ; } function nthTerm ( N ) { return ( factorial ( N ) * ( N + 2 ) / 2 ) ; } let N = 6 ; document . write ( nthTerm ( N ) ) ;