Second Pentagonal numbers | Java implementation to find N - th term in the series ; Function to find N - th term in the series ; Driver code
class GFG { static void findNthTerm ( int n ) { System . out . print ( n * ( 3 * n + 1 ) / 2 + "NEW_LINE"); } public static void main ( String [ ] args ) { int N = 4 ; findNthTerm ( N ) ; } }