Octahedral Number | Function to find octahedral number ; Formula to calculate nth octahedral number ; Driver Code ; print result
def octahedral_num ( n ) : NEW_LINE INDENT return n * ( 2 * n * n + 1 ) // 3 NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT n = 5 NEW_LINE print ( n , " th ▁ Octahedral ▁ number : ▁ " , octahedral_num ( n ) ) NEW_LINE DEDENT