
    Design a fraud detection algorithm that analyzes transaction patterns over 2n time intervals, where each interval is marked as suspicious (1) or normal (0), and determines the number of possible pattern sequences where the count of suspicious transactions in the first n intervals equals the count in the last n intervals.
    

    
def count_binary_seq(n):
    """
    Design a fraud detection algorithm that analyzes transaction patterns over 2n time intervals, where each interval is marked as suspicious (1) or normal (0), and determines the number of possible pattern sequences where the count of suspicious transactions in the first n intervals equals the count in the last n intervals.
    

    """
def count_binary_seq(n):
    """
    Design a fraud detection algorithm that analyzes transaction patterns over 2n time intervals, where each interval is marked as suspicious (1) or normal (0), and determines the number of possible pattern sequences where the count of suspicious transactions in the first n intervals equals the count in the last n intervals.
    

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