Centered decagonal number | Centered decagonal number function ; Formula to calculate nth centered decagonal number & return it into main function . ; Driver Code
< ? php function centereddecagonalnum ( $ n ) { return ( 5 * $ n * $ n + 5 * $ n + 1 ) ; } $ n = 5 ; echo $ n , " th ▁ centered ▁ decagonal " , " number : ▁ " ; echo centereddecagonalnum ( $ n ) ; echo " STRNEWLINE " ; $ n = 9 ; echo $ n , " th ▁ centered ▁ decagonal " , " number : ▁ " ; echo centereddecagonalnum ( $ n ) ; ? >