Ask Your Question

Revision history [back]

Monomial with power modulo n

I need to implement the following formal structure $$ax^\gamma, \gamma \in \mathbb{Z}/n\mathbb{Z}, a \in \mathbb{R}$$ and $x$ is a formal variable.

I tried

ZZ6 = Integers(6) x = var('x') x^ZZ6(9) + x^ZZ6(11)

And get value x^8, whereas I need x^ZZ6(8).

How can I do this in sage?