Skip to content

Instantly share code, notes, and snippets.

@skaslev
Created October 23, 2013 06:30
Show Gist options
  • Save skaslev/7113484 to your computer and use it in GitHub Desktop.
Save skaslev/7113484 to your computer and use it in GitHub Desktop.
from numpy.polynomial.polynomial import *
z=Polynomial([0,1])
def Gn(n, G):
if n == 0:
return z
else:
return G(Gn(n-1,G))
def G(z):
return z**2 + z**3
f = sum([Gn(n, G) for n in range(10)])
print f.coef[:22]
plot(f.coef[:22])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment