n | java program to find n - th term of the series 2 , 12 , 36 , 80 , 150 , . . ; Returns n - th term of the series 2 , 12 , 36 , 80 , 150 ; Driver code
import java . util . * ; class GFG { public static int nthTerm ( int n ) { return ( n * n ) + ( n * n * n ) ; } public static void main ( String [ ] args ) { int n = 4 ; System . out . print ( nthTerm ( n ) ) ; } }