Centered heptagonal number | Function to find Centered heptagonal number ; Formula to calculate nth Centered heptagonal number ; Driver Code
< ? php function centered_heptagonal_num ( $ n ) { return ( 7 * $ n * $ n - 7 * $ n + 2 ) / 2 ; } $ n = 5 ; echo $ n , " th ▁ Centered ▁ heptagonal ▁ number ▁ : ▁ " ; echo centered_heptagonal_num ( $ n ) ; ? >