Centered pentagonal number | Centered pentagonal number function ; Formula to calculate nth Centered pentagonal number and return it into main function . ; Driver Code
< ? php function centered_pentagonal_Num ( $ n ) { return ( 5 * $ n * $ n - 5 * $ n + 2 ) / 2 ; } $ n = 7 ; echo $ n , " th ▁ Centered ▁ pentagonal ▁ number : ▁ " ; echo centered_pentagonal_Num ( $ n ) ; ? >