
    Given a time interval n in minutes, determine the optimal number of buses to deploy by calculating the nth term in a dynamic scheduling sequence where each term is equal to the sum of the sequence values at positions P(P(n-1)) and P(n-P(n-1)), with P(1)=1 and P(2)=1 representing the base deployment pattern.
    

    
def sequence(n):
    """
    Given a time interval n in minutes, determine the optimal number of buses to deploy by calculating the nth term in a dynamic scheduling sequence where each term is equal to the sum of the sequence values at positions P(P(n-1)) and P(n-P(n-1)), with P(1)=1 and P(2)=1 representing the base deployment pattern.
    

    """
def sequence(n):
    """
    Given a time interval n in minutes, determine the optimal number of buses to deploy by calculating the nth term in a dynamic scheduling sequence where each term is equal to the sum of the sequence values at positions P(P(n-1)) and P(n-P(n-1)), with P(1)=1 and P(2)=1 representing the base deployment pattern.
    

    """
    if n == 1 or n == 2:
        return 1
    else:
        return sequence(sequence(n - 1)) + sequence(n - sequence(n - 1))