Tetrahedral Numbers | Python3 Program to find the nth tetrahedral number ; Function to find Tetrahedral Number ; Driver Code
def tetrahedralNumber ( n ) : NEW_LINE INDENT return ( n * ( n + 1 ) * ( n + 2 ) ) / 6 NEW_LINE DEDENT def tetrahedralNumber ( n ) : NEW_LINE INDENT return ( n * ( n + 1 ) * ( n + 2 ) ) / 6 NEW_LINE DEDENT n = 5 NEW_LINE print ( tetrahedralNumber ( n ) ) NEW_LINE