Icosidigonal number | Java program to find nth Icosidigonal number ; Function to calculate Icosidigonal number ; Formula for finding nth Icosidigonal number ; Driver Code
import java . io . * ; class GFG { static int icosidigonal_num ( int n ) { return ( 20 * n * n - 18 * n ) / 2 ; } public static void main ( String [ ] args ) { int n = 4 ; System . out . print ( n + " th ▁ Icosidigonal ▁ number ▁ : " ) ; System . out . println ( icosidigonal_num ( n ) ) ; n = 8 ; System . out . print ( n + " th ▁ Icosidigonal ▁ number ▁ : " ) ; System . out . println ( icosidigonal_num ( n ) ) ; } }