
    Given a patient's digital health record containing 2n binary indicators split equally between historical and current vital sign thresholds, determine the number of possible health pattern sequences where the count of concerning indicators in the historical period matches the count in the current period. The length of both historical and current periods is n, and each indicator is represented as a binary value (1 for concerning, 0 for normal).
    

    
def count_binary_seq(n):
    """
    Given a patient's digital health record containing 2n binary indicators split equally between historical and current vital sign thresholds, determine the number of possible health pattern sequences where the count of concerning indicators in the historical period matches the count in the current period. The length of both historical and current periods is n, and each indicator is represented as a binary value (1 for concerning, 0 for normal).
    

    """
def count_binary_seq(n):
    """
    Given a patient's digital health record containing 2n binary indicators split equally between historical and current vital sign thresholds, determine the number of possible health pattern sequences where the count of concerning indicators in the historical period matches the count in the current period. The length of both historical and current periods is n, and each indicator is represented as a binary value (1 for concerning, 0 for normal).
    

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