Centered Octadecagonal Number | centered octadecagon function ; Formula to calculate nth centered octadecagonal number ; Driver Code
< ? php function center_octadecagon_num ( $ n ) { return ( 9 * $ n * $ n - 9 * $ n + 1 ) ; } $ n = 3 ; echo $ n , " th ▁ centered ▁ octadecagonal ▁ " . " number ▁ : ▁ " , center_octadecagon_num ( $ n ) ; echo " STRNEWLINE " ; $ n = 13 ; echo $ n , " th ▁ centered ▁ octadecagonal ▁ " . " number ▁ : ▁ " , center_octadecagon_num ( $ n ) ; ? >