
    Design an algorithm for a loan approval system that determines the number of possible income growth patterns over n consecutive verification periods that would qualify for a maximum loan amount of m dollars, where each period's income must be at least double the previous period's income. The system needs to analyze these patterns to ensure the applicant's income demonstrates consistent growth while staying within the bank's maximum lending threshold of m dollars.
    

    
def get_total_number_of_sequences(m, n):
    """
    Design an algorithm for a loan approval system that determines the number of possible income growth patterns over n consecutive verification periods that would qualify for a maximum loan amount of m dollars, where each period's income must be at least double the previous period's income. The system needs to analyze these patterns to ensure the applicant's income demonstrates consistent growth while staying within the bank's maximum lending threshold of m dollars.
    

    """
def get_total_number_of_sequences(m, n):
    """
    Design an algorithm for a loan approval system that determines the number of possible income growth patterns over n consecutive verification periods that would qualify for a maximum loan amount of m dollars, where each period's income must be at least double the previous period's income. The system needs to analyze these patterns to ensure the applicant's income demonstrates consistent growth while staying within the bank's maximum lending threshold of m dollars.
    

    """
    T = [[0 for i in range(n + 1)] for i in range(m + 1)]
    for i in range(m + 1):
        for j in range(n + 1):
            if i == 0 or j == 0:
                T[i][j] = 0
            elif i < j:
                T[i][j] = 0
            elif j == 1:
                T[i][j] = i
            else:
                T[i][j] = T[i - 1][j] + T[i // 2][j - 1]
    return T[m][n]