
    Design an algorithm for a smart parking management system that calculates the total number of available parking spaces in a pyramid-shaped structure with n levels, where each level contains parking spots arranged in a triangular pattern. The structure follows a tetrahedral design where level 1 has one spot, level 2 has three spots arranged in a triangle, and each subsequent level follows this pattern, helping urban planners determine total parking capacity for space optimization.
    

    
def tetrahedral_number(n):
    """
    Design an algorithm for a smart parking management system that calculates the total number of available parking spaces in a pyramid-shaped structure with n levels, where each level contains parking spots arranged in a triangular pattern. The structure follows a tetrahedral design where level 1 has one spot, level 2 has three spots arranged in a triangle, and each subsequent level follows this pattern, helping urban planners determine total parking capacity for space optimization.
    

    """
def tetrahedral_number(n):
    """
    Design an algorithm for a smart parking management system that calculates the total number of available parking spaces in a pyramid-shaped structure with n levels, where each level contains parking spots arranged in a triangular pattern. The structure follows a tetrahedral design where level 1 has one spot, level 2 has three spots arranged in a triangle, and each subsequent level follows this pattern, helping urban planners determine total parking capacity for space optimization.
    

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