answered 4 years ago
another way
sage: R = Zmod(6) sage: A = R.algebra(QQ,category=CommutativeAdditiveSemigroups()) sage: x = A.gens()[1] sage: 3*x+x**4 3*B[1] + B[4] sage: _**4 120*B[1] + 136*B[4]