Dear Sage supporters, assume that one has an element of the fraction field of a univariate polynomial ring, say sage: R.<t> = QQ[] sage: p = 1/(t^2-2*t+1)
How can one express p as a formal power series? More precisely: How can one obtain the coefficient of, say, t^100 in said power series? This works: sage: PS = PowerSeriesRing(QQ, 't',default_prec=101) sage: f = PS(p.numerator())/PS(p.denominator()) sage: f.coefficients()[100] 101 But is there a less clumsy way? And what happens if I later want to know the 1234-th coefficient? I know that there is a LazyPowerSeriesRing, but after reading some of its doc strings, I am still not able to produce something meaningful -- for example: sage: PS = LazyPowerSeriesRing(QQ,names=['t']) sage: PS([1]).coefficients(5) [1, 1, 1, 1, 1] I would expect [1,0,0,0,0], and as much as I can see, the documentation does *not* point out that the last entry of the given list will be repeated: sage: PS([1,2,3]).coefficients(5) [1, 2, 3, 3, 3] In fact, the documentation does not clearly state what kind of input is expected and how it is processed. Also, it seems that there is no division in the LazyPowerSeriesRing, as opposed to the PowerSeriesRing. Best regards, Simon --~--~---------~--~----~------------~-------~--~----~ 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 URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---