
    Write a function to determine how many possible attendance patterns exist over 2n academic periods where the number of days attended in the first n periods equals the number of days attended in the last n periods, with each period marked as either present (1) or absent (0).
    

    
def count_binary_seq(n):
    """
    Write a function to determine how many possible attendance patterns exist over 2n academic periods where the number of days attended in the first n periods equals the number of days attended in the last n periods, with each period marked as either present (1) or absent (0).
    

    """
def count_binary_seq(n):
    """
    Write a function to determine how many possible attendance patterns exist over 2n academic periods where the number of days attended in the first n periods equals the number of days attended in the last n periods, with each period marked as either present (1) or absent (0).
    

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