Centered hexagonal number | Function to find centered hexadecimal number . ; Formula to calculate nth centered hexadecimal number and return it into main function . ; Driver Code
< ? php function centeredHexagonalNumber ( $ n ) { return 3 * $ n * ( $ n - 1 ) + 1 ; } $ n = 10 ; echo $ n , " th ▁ centered ▁ hexagonal ▁ number : ▁ " ; echo centeredHexagonalNumber ( $ n ) ; ? >