
    Write a function that determines the total number of possible emergency room occupancy patterns over 2n time slots, where each slot is marked as either high capacity (1) or normal capacity (0), such that the number of high-capacity periods in the first n slots equals the number in the last n slots. This balanced pattern analysis helps hospitals identify and plan for recurring load distributions across different parts of the day.
    

    
def count_binary_seq(n):
    """
    Write a function that determines the total number of possible emergency room occupancy patterns over 2n time slots, where each slot is marked as either high capacity (1) or normal capacity (0), such that the number of high-capacity periods in the first n slots equals the number in the last n slots. This balanced pattern analysis helps hospitals identify and plan for recurring load distributions across different parts of the day.
    

    """
def count_binary_seq(n):
    """
    Write a function that determines the total number of possible emergency room occupancy patterns over 2n time slots, where each slot is marked as either high capacity (1) or normal capacity (0), such that the number of high-capacity periods in the first n slots equals the number in the last n slots. This balanced pattern analysis helps hospitals identify and plan for recurring load distributions across different parts of the day.
    

    """
    nCr = 1
    res = 1
    for r in range(1, n + 1):
        nCr = nCr * (n + 1 - r) / r
        res += nCr * nCr
    return res