Alternation via the Euler's identity

from sympy import trigsimp, exp, pi, I print([trigsimp(exp(pi*I)) ** (i+1) for i in range(10)]) # [-1, 1, -1, 1, -1, 1, -1, 1, -1, 1]