Find sum of N | Java program to find sum in Nth group ; calculate sum of Nth group ; Driver code
import java . util . * ; class GFG { static int nth_group ( int n ) { return n * ( 2 * ( int ) Math . pow ( n , 2 ) + 1 ) ; } public static void main ( String arr [ ] ) { int N = 5 ; System . out . println ( nth_group ( N ) ) ; } }