Ask Your Question

Revision history [back]

The issue is in the definition of R. From the documentation for PowerSeriesRIng, one of the arguments is

  • "default_prec" -- the default precision used if an exact object must be changed to an approximate object in order to do an arithmetic operation. If left as "None", it will be set to the global default (20) in the univariate case, and 12 in the multivariate case.

So if you want higher precision than degree 20, you have to specify that when you define the ring:

R.<x> = PowerSeriesRing(ZZ, 51)
f25 = 1/(1-x^25)
print(f25)

gives 1 + x^25 + x^50 + O(x^51) while

R.<x> = PowerSeriesRing(ZZ, 200)
f25 = 1/(1-x^25)
print(f25)

gives 1 + x^25 + x^50 + x^75 + x^100 + x^125 + x^150 + x^175 + O(x^200).

The issue is in the definition of R. From the documentation for PowerSeriesRIngPowerSeriesRing, one of the arguments is

  • "default_prec" -- the default precision used if an exact object must be changed to an approximate object in order to do an arithmetic operation. If left as "None", it will be set to the global default (20) in the univariate case, and 12 in the multivariate case.

So if you want higher precision than degree 20, you have to specify that when you define the ring:

R.<x> = PowerSeriesRing(ZZ, 51)
f25 = 1/(1-x^25)
print(f25)

gives 1 + x^25 + x^50 + O(x^51) while

R.<x> = PowerSeriesRing(ZZ, 200)
f25 = 1/(1-x^25)
print(f25)

gives 1 + x^25 + x^50 + x^75 + x^100 + x^125 + x^150 + x^175 + O(x^200).