Centered cube number | Function to find Centered cube number ; Formula to calculate nth Centered cube number & return it into main function . ; Driver Code
< ? php function centered_cube ( $ n ) { return ( 2 * $ n + 1 ) * ( $ n * $ n + $ n + 1 ) ; } $ n = 3 ; echo $ n , " th ▁ Centered ▁ cube ▁ number : ▁ " ; echo centered_cube ( $ n ) ; echo " STRNEWLINE " ; $ n = 10 ; echo $ n , " th ▁ Centered ▁ cube ▁ number : ▁ " ; echo centered_cube ( $ n ) ; ? >