Centered Square Number | Function to calculate Centered square number function ; Formula to calculate nth Centered square number ; Driver Code
< ? php function centered_square_num ( $ n ) { return $ n * $ n + ( ( $ n - 1 ) * ( $ n - 1 ) ) ; } $ n = 7 ; echo $ n , " th ▁ Centered ▁ square ▁ number : ▁ " ; echo centered_square_num ( $ n ) ; ? >