Centered Octadecagonal Number | centered octadecagon function ; Formula to calculate nth centered octadecagonal number ; Driver Code
function center_octadecagon_num ( n ) { return 9 * n * n - 9 * n + 1 ; } var n = 3 ; document . write ( n + " " + " " ) ; document . write ( center_octadecagon_num ( n ) + " " ) ; n = 13 ; document . write ( n + " " + " " ) ; document . write ( center_octadecagon_num ( n ) ) ;