Find the Nth term of the series 2 , 15 , 41 , 80 , 132. . . | Java program for the above approach ; Recursive function to find Nth term ; Base Case ; Recursive Call according to Nth term of the series ; Driver Code ; Input Nth term ; Function call
class GFG { static int nthTerm ( int N ) { if ( N == 1 ) { return 2 ; } return ( ( N - 1 ) * 13 ) + nthTerm ( N - 1 ) ; } public static void main ( String [ ] args ) { int N = 17 ; System . out . print ( nthTerm ( N ) + "NEW_LINE"); } }