Minimum value possible of a given function from the given set | C # implementation of above approach ; Function to find the value of F ( n ) ; Driver code
using System ; class GFG { static long findF_N ( long n ) { long ans = 0 ; for ( long i = 0 ; i < n ; ++ i ) ans += ( i + 1 ) * ( n - i - 1 ) ; return ans ; } public static void Main ( ) { long n = 3 ; Console . WriteLine ( findF_N ( n ) ) ; } }