Centered tetrahedral number | Function to calculate Centered tetrahedral number ; Formula to calculate nth Centered tetrahedral number and return it into main function ; Driver Code
def centeredTetrahedralNumber ( n ) : NEW_LINE INDENT return ( 2 * n + 1 ) * ( n * n + n + 3 ) // 3 NEW_LINE DEDENT n = 6 NEW_LINE print ( centeredTetrahedralNumber ( n ) ) NEW_LINE