Find the sum of first N terms of the series 2 Ã — 3 + 4 Ã — 4 + 6 Ã — 5 + 8 Ã — 6 + ... | Java program to find sum upto N term of the series : ; calculate sum upto N term of series ; Driver code
import java . io . * ; class GFG { static void Sum_upto_nth_Term ( int n ) { int r = n * ( n + 1 ) * ( 2 * n + 7 ) / 3 ; System . out . println ( r ) ; } public static void main ( String [ ] args ) { int N = 5 ; Sum_upto_nth_Term ( N ) ; } }