
    Given a user profile comparison pattern of length 2n where each bit represents a matching criterion between two users (1 for match, 0 for no match), determine how many different possible patterns exist where the first n matching criteria have the same number of matches as the last n criteria. This balanced matching pattern helps ensure recommendations are based on equal strength of compatibility factors from both halves of the comparison criteria.
    

    
def count_binary_seq(n):
    """
    Given a user profile comparison pattern of length 2n where each bit represents a matching criterion between two users (1 for match, 0 for no match), determine how many different possible patterns exist where the first n matching criteria have the same number of matches as the last n criteria. This balanced matching pattern helps ensure recommendations are based on equal strength of compatibility factors from both halves of the comparison criteria.
    

    """
def count_binary_seq(n):
    """
    Given a user profile comparison pattern of length 2n where each bit represents a matching criterion between two users (1 for match, 0 for no match), determine how many different possible patterns exist where the first n matching criteria have the same number of matches as the last n criteria. This balanced matching pattern helps ensure recommendations are based on equal strength of compatibility factors from both halves of the comparison criteria.
    

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