Is there a way to speed up the following nested loop?
reset()
mylimit=100
R = PolynomialRing(RR, 'a', mylimit)
a = R.gens()
func=0
for n in range(mylimit):
for i in range(n+1):
term1=(x^i)/(i+2)
for j in range(i+1):
term2=(x^(j+1))/(2*j+1)
for k in range(n-i-j+1):
term3=a[k]*(x^k)
term4=x^((n-k-i-j))/(2*(n-k-i)+1)
func=func+term1*term2*term3*term4