
    Design a function that analyzes a customer's credit behavior pattern of length 2n months, where each month is marked as good (1) or poor (0) credit standing, and determine the number of possible patterns where the customer shows equal credit performance in the first n months compared to the last n months. The analysis will help determine if a customer's financial behavior is consistently balanced across two equal time periods for loan approval consideration.
    

    
def count_binary_seq(n):
    """
    Design a function that analyzes a customer's credit behavior pattern of length 2n months, where each month is marked as good (1) or poor (0) credit standing, and determine the number of possible patterns where the customer shows equal credit performance in the first n months compared to the last n months. The analysis will help determine if a customer's financial behavior is consistently balanced across two equal time periods for loan approval consideration.
    

    """
def count_binary_seq(n):
    """
    Design a function that analyzes a customer's credit behavior pattern of length 2n months, where each month is marked as good (1) or poor (0) credit standing, and determine the number of possible patterns where the customer shows equal credit performance in the first n months compared to the last n months. The analysis will help determine if a customer's financial behavior is consistently balanced across two equal time periods for loan approval consideration.
    

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