Formula:
The imaginary unit `i` is fundamentally defined as the square root of -1 (i.e., `i = √-1`). When `i` is raised to an integer power `n` (represented as `in`), its value exhibits a distinct cyclic pattern that repeats every four powers:
- `i0 = 1` (By definition, any non-zero number to the power of zero is 1)
- `i1 = i`
- `i2 = -1` (Since `i * i = √-1 * √-1 = -1`)
- `i3 = -i` (Since `i3 = i2 * i = -1 * i = -i`)
- `i4 = 1` (Since `i4 = i2 * i2 = -1 * -1 = 1`)
Let `r = n mod 4`.
Then, `in` will have the same value as `ir`.
For negative exponents, `i-n = 1 / in`, which also follows the same cyclic pattern.