
    Given a sequence of interconnected fraudulent transactions forming a pyramid pattern where each layer builds upon previous suspicious activities, develop a function that calculates the total number of connected transactions that need to be investigated when examining n levels deep into the network. Each level adds a triangular pattern of connections to the previous layers, creating a three-dimensional network of related fraudulent activities.
    

    
def tetrahedral_number(n):
    """
    Given a sequence of interconnected fraudulent transactions forming a pyramid pattern where each layer builds upon previous suspicious activities, develop a function that calculates the total number of connected transactions that need to be investigated when examining n levels deep into the network. Each level adds a triangular pattern of connections to the previous layers, creating a three-dimensional network of related fraudulent activities.
    

    """
def tetrahedral_number(n):
    """
    Given a sequence of interconnected fraudulent transactions forming a pyramid pattern where each layer builds upon previous suspicious activities, develop a function that calculates the total number of connected transactions that need to be investigated when examining n levels deep into the network. Each level adds a triangular pattern of connections to the previous layers, creating a three-dimensional network of related fraudulent activities.
    

    """
    return n * (n + 1) * (n + 2) / 6