Program to find the Nth term of series | Java program to find N - th term of the series : 9 , 23 , 45 , 75 , 113 , 159. . ... . ; calculate Nth term of series ; Driver code ; Get the value of N ; Find the Nth term and print it
class GFG { static int nthTerm ( int N ) { return ( ( 3 * N * N ) - ( 6 * N ) + 2 ) ; } public static void main ( String [ ] args ) { int N = 3 ; System . out . println ( nthTerm ( N ) ) ; } }