Ask Your Question

PaulRa's profile - activity

2023-05-19 17:53:35 +0200 received badge  Popular Question (source)
2019-04-11 10:03:27 +0200 commented answer Coefficients of inversed polynomial

Thanks.

Maybe I can at least divide 1 by polynomial and get quotient and remainder? I can compute these coefficients by myself this way, but quo_rem method returns the trivial answer (0, 1).

2019-04-11 01:34:43 +0200 received badge  Student (source)
2019-04-11 01:07:18 +0200 asked a question Coefficients of inversed polynomial

I want to lazily compute coefficients of inversed integer based polynomial.

For example, I have: $$ P = 1 - x $$ and I want to get formal power series of it's inverse: $$ \frac{1}{P} = \frac{1}{1-x} = 1 + x + x^2 + \dots $$

But actually, I would like to get the n-th coefficient of it.

How can I do it?

P.S: I tried the following code, but it computes only 20 coefficients:

sage:> F.<x> = PowerSeriesRing(ZZ); F
sage:> F([1])/(1-x)
1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^10 + x^11 + x^12 + x^13 + x^14 + x^15 + x^16 + x^17 + x^18 + x^19 + O(x^20)

I think I can change precision every time I want to get a coefficient bigger than default 20, but it requires recomputing of that power series, so I want to know is there another way.