Program to find the Nth term of series 5 , 12 , 21 , 32 , 45. ... . . | Java program to find the N - th term of the series : 5 , 12 , 21 , 32 , 45. . ... . ; calculate Nth term of series ; Driver code
import java . io . * ; class GFG { static int nthTerm ( int n ) { return ( int ) Math . pow ( n , 2 ) + 4 * n ; } public static void main ( String [ ] args ) { int N = 4 ; System . out . println ( nthTerm ( N ) ) ; } }