Program to find Nth term of series 0 , 7 , 18 , 33 , 51 , 75 , 102 , 133 , ... . . | Java program to find the N - th term of the series : 0 , 7 , 18 , 33 , 51 , 75 , 102 , ... . . ; calculate Nth term of series ; Driver code
import java . io . * ; class GFG { static int nthTerm ( int n ) { return 2 * ( int ) Math . pow ( n , 2 ) + n - 3 ; } public static void main ( String [ ] args ) { int N = 4 ; System . out . println ( nthTerm ( N ) ) ; } }