I have a variable (say, e) that can assume only the values $1$ or $-1$. My calculations are extensive and if I introduce the symbol e to represent these possible values ($1$ or $-1$), I get an output with several powers of e.
I can, of course, after the calculation is done, simplify the result through a list that replace the even powers of e by $1$, and the odd powers by e. However, I would like instead to define a symbol e so that Mathematica understands (automatically, even in the middle of its calculations) that e^2 is 1 and e^3 == e (etc.).
In other words, I want Mathematica to treat e in the same manner as it treats the imaginary number I, except that e^2 == 1 instead of $-1$ (etc.) Is that possible in Mathematica or in Maple? Thanks.