Program for Centered Icosahedral Number | Java Program to find nth Centered icosahedral number Java Program to find nth Centered icosahedral number ; Function to find Centered icosahedral number ; Formula to calculate nth Centered icosahedral number and return it into main function . ; Driver Code
import java . io . * ; class GFG { static int centeredIcosahedralNum ( int n ) { return ( 2 * n + 1 ) * ( 5 * n * n + 5 * n + 3 ) / 3 ; } public static void main ( String [ ] args ) { int n = 10 ; System . out . println ( centeredIcosahedralNum ( n ) ) ; n = 12 ; System . out . println ( centeredIcosahedralNum ( n ) ) ; } }