
    Design a fraud detection algorithm that calculates the total number of transaction relationships to analyze when examining n levels of suspicious transaction patterns, where each new level forms a triangular layer of connected transactions above the previous ones. The relationships between transactions form a tetrahedral structure, with each level containing more interconnected transactions than the previous one, and the total count of relationships follows the tetrahedral number sequence.
    

    
def tetrahedral_number(n):
    """
    Design a fraud detection algorithm that calculates the total number of transaction relationships to analyze when examining n levels of suspicious transaction patterns, where each new level forms a triangular layer of connected transactions above the previous ones. The relationships between transactions form a tetrahedral structure, with each level containing more interconnected transactions than the previous one, and the total count of relationships follows the tetrahedral number sequence.
    

    """
def tetrahedral_number(n):
    """
    Design a fraud detection algorithm that calculates the total number of transaction relationships to analyze when examining n levels of suspicious transaction patterns, where each new level forms a triangular layer of connected transactions above the previous ones. The relationships between transactions form a tetrahedral structure, with each level containing more interconnected transactions than the previous one, and the total count of relationships follows the tetrahedral number sequence.
    

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