Ask Your Question

Revision history [back]

You can try to convert g as an element of the ring R by calling R(g) (it is a general syntax):

sage: G = R(g)
sage: G
1 - x + x^2
sage: G.parent()
Power Series Ring in x over Integer Ring
sage: G.inverse()
1 + x - x^3 - x^4 + x^6 + x^7 - x^9 - x^10 + x^12 + x^13 - x^15 - x^16 + x^18 + x^19 + O(x^20)
sage: G.inverse().list()
[1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1]