
    Design a fraud detection function that analyzes credit card transaction sequences of length 2n, where each transaction is marked as either suspicious (1) or normal (0), and determines how many possible transaction patterns exist where the number of suspicious transactions in the first n transactions equals the number of suspicious transactions in the last n transactions.
    

    
def count_binary_seq(n):
    """
    Design a fraud detection function that analyzes credit card transaction sequences of length 2n, where each transaction is marked as either suspicious (1) or normal (0), and determines how many possible transaction patterns exist where the number of suspicious transactions in the first n transactions equals the number of suspicious transactions in the last n transactions.
    

    """
def count_binary_seq(n):
    """
    Design a fraud detection function that analyzes credit card transaction sequences of length 2n, where each transaction is marked as either suspicious (1) or normal (0), and determines how many possible transaction patterns exist where the number of suspicious transactions in the first n transactions equals the number of suspicious transactions in the last n transactions.
    

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