擅长:python、mysql、java
<p>作为一个动态规划:</p>
<pre><code>def mot(t):
M = [1, 1]
for n in range(2, t+1):
M.append(((2*n + 1)*M[n-1] + (3*n - 3)*M[n-2]) // (n + 2))
return M
In []:
mot(4)
Out[]:
[1, 1, 2, 4, 9]
In []:
mot(10)
Out[]:
[1, 1, 2, 4, 9, 21, 51, 127, 323, 835, 2188]
</code></pre>