Octahedral Number | Function to find octahedral number ; Formula to calculate nth octahedral number and return it into main function . ; Drivers Code ; print result
< ? php function octahedral_num ( $ n ) { return $ n * ( 2 * $ n * $ n + 1 ) / 3 ; } $ n = 5 ; echo $ n , " th ▁ Octahedral ▁ number : ▁ " ; echo octahedral_num ( $ n ) ; ? >