Minimum value possible of a given function from the given set | Function to find the value of F ( n ) ; Driver code
function findF_N ( n ) { var ans = 0 ; for ( var i = 0 ; i < n ; ++ i ) ans += ( i + 1 ) * ( n - i - 1 ) ; return ans ; } var n = 3 ; document . write ( findF_N ( n ) ) ;