text: Central polygonal numbers | Java program to find N - th term in the series ; Function to find N - th term in the series ; Driver code
code: class GFG { static void findNthTerm ( int n ) { System . out . println ( n * n - n + 1 ) ; } public static void main ( String [ ] args ) { int N = 4 ; findNthTerm ( N ) ; } }