Sum of Series ( n ^ 2 | javaProgram to finding the sum of the nth series ; function that calculate the sum of the nth series ; using formula of the nth term ; Driver function
import java . io . * ; class GFG { static int sum_series ( int n ) { int nSquare = n * n ; return nSquare * ( nSquare - 1 ) / 4 ; } public static void main ( String [ ] args ) { int n = 2 ; System . out . println ( sum_series ( n ) ) ; } }