
    Design a function for the event recommendation system that identifies the number of possible user interest patterns of length 2n where users show equal interest levels across both halves of event categories. Each interest pattern consists of binary values (interested/not interested) across 2n event categories, and the system needs to find patterns where the count of interested responses in the first n categories matches the count in the last n categories.
    

    
def count_binary_seq(n):
    """
    Design a function for the event recommendation system that identifies the number of possible user interest patterns of length 2n where users show equal interest levels across both halves of event categories. Each interest pattern consists of binary values (interested/not interested) across 2n event categories, and the system needs to find patterns where the count of interested responses in the first n categories matches the count in the last n categories.
    

    """
def count_binary_seq(n):
    """
    Design a function for the event recommendation system that identifies the number of possible user interest patterns of length 2n where users show equal interest levels across both halves of event categories. Each interest pattern consists of binary values (interested/not interested) across 2n event categories, and the system needs to find patterns where the count of interested responses in the first n categories matches the count in the last n categories.
    

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