
    In a medical monitoring system for elderly patients, write a function that determines how many possible vital sign patterns can occur over a 2n-second window, where each second is marked as normal (0) or elevated (1), such that the count of elevated readings in the first n seconds equals the count in the last n seconds.
    

    
def count_binary_seq(n):
    """
    In a medical monitoring system for elderly patients, write a function that determines how many possible vital sign patterns can occur over a 2n-second window, where each second is marked as normal (0) or elevated (1), such that the count of elevated readings in the first n seconds equals the count in the last n seconds.
    

    """
def count_binary_seq(n):
    """
    In a medical monitoring system for elderly patients, write a function that determines how many possible vital sign patterns can occur over a 2n-second window, where each second is marked as normal (0) or elevated (1), such that the count of elevated readings in the first n seconds equals the count in the last n seconds.
    

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