问题描述:
Write a function to find the number of possible sequences of length n such that each of the next element is greater than or equal to twice of the previous element but less than or equal to m.

测试用例:
['assert get_total_number_of_sequences(10, 4) == 4', 'assert get_total_number_of_sequences(5, 2) == 6', 'assert get_total_number_of_sequences(16, 3) == 84']

生成的代码:
def get_total_number_of_sequences(n, m):
    dp = [[0] * (m + 1) for _ in range(n + 1)]
    
    for i in range(1, m + 1):
        dp[1][i] = 1
        
    for length in range(2, n + 1):
        for last in range(1, m + 1):
            start = (last + 1) // 2
            end = min(last * 2, m)
            if start <= end:
                dp[length][last] = sum(dp[length - 1][j] for j in range(start, end + 1))
    
    return sum(dp[n][j] for j in range(1, m + 1))

# Test cases
assert get_total_number_of_sequences(10, 4) == 4
assert get_total_number_of_sequences(5, 2) == 6
assert get_total_number_of_sequences(16, 3) == 84