Sum of sum | Java program to implement the above approach ; Function to find the sum ; Driver code
class GFG { static long sumOfSumSeries ( int n ) { return ( n * ( n + 1 ) * ( n + 2 ) ) / 6 ; } public static void main ( String [ ] args ) { int N = 5 ; System . out . println ( sumOfSumSeries ( N ) ) ; } }