On Sun, Jan 17, 2010 at 10:11 PM, Rolandb <rola...@planet.nl> wrote: > Hi, > > Consider: > > def tau(m): > q = PowerSeriesRing(QQ, 'q', default_prec=12).gen() > pq=prod([(1-q^k)^24 for k in range(1,m)]) > return pq.coefficients()[:m] > > tau(20) > [1, -24, 252, -1472, 4830, -6048, -16744, 84480, -113643, -115920, > 534612, -370944, -577738, 401856, 1217160, 987136, -6905934, 2727432, > 10661420, -7109760] > > If m increases, this routine becomes is slow. Is there a fast routine > (or table) for large m?
Use the delta_qexp command: sage: delta_qexp(20) q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 - 16744*q^7 + 84480*q^8 - 113643*q^9 - 115920*q^10 + 534612*q^11 - 370944*q^12 - 577738*q^13 + 401856*q^14 + 1217160*q^15 + 987136*q^16 - 6905934*q^17 + 2727432*q^18 + 10661420*q^19 + O(q^20) and sage: list(delta_qexp(20)) # the list you have above The command delta_qexp(20) is extremely fast. In fact, I think it is the fastest implementation of that command available in any general math software. (Thanks basically to David Harvey, Bill Hart, and Craig Citro.) William
-- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org