Created
April 9, 2017 03:13
-
-
Save GM3D/5de2ba1dec67285d9ce01cca9f12a297 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sympy import sqrt | |
N = 15 | |
a = [[]]*N | |
for n in range(N): | |
a[n] = [0]*(n+1) | |
if n == 0: | |
a[0][0] = 1 | |
else: | |
for l in range(n + 1): | |
A = a[n-1][l+1] * sqrt(l+1) if l + 1 <= n - 1 else 0 | |
B = a[n-1][l-1] * sqrt(l) if l - 1 >= 0 else 0 | |
a[n][l] = A + B | |
for n in range(N): | |
print(a[n]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment