
    In a patient monitoring system that records vital sign status checks as binary values (1 for normal, 0 for abnormal) over two consecutive periods of equal length n, determine how many possible sequences exist where the count of normal readings in the first period equals the count of normal readings in the second period. The system needs this to identify balanced patterns in patient condition changes across monitoring intervals.
    

    
def count_binary_seq(n):
    """
    In a patient monitoring system that records vital sign status checks as binary values (1 for normal, 0 for abnormal) over two consecutive periods of equal length n, determine how many possible sequences exist where the count of normal readings in the first period equals the count of normal readings in the second period. The system needs this to identify balanced patterns in patient condition changes across monitoring intervals.
    

    """
def count_binary_seq(n):
    """
    In a patient monitoring system that records vital sign status checks as binary values (1 for normal, 0 for abnormal) over two consecutive periods of equal length n, determine how many possible sequences exist where the count of normal readings in the first period equals the count of normal readings in the second period. The system needs this to identify balanced patterns in patient condition changes across monitoring intervals.
    

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