Suppose I have a string of length $n$, such as
12345 (when $n=5$)
or more generally,
123($\ldots$)$n$.
I want to reverse the string, so that 12345 becomes 54321. This reversal can be thought of as a permutation $\sigma$ of the characters in the string.
What I would like to know is, what is the parity of the reversal permutation, given as a function of the string length (the number of elements)?
For example, for $n= 1, 2, 3, 4$, the reversal parities are even, odd, odd, even respectively.
Partial work: Equivalently, we just need to know the value of the function $f(n) = \frac{n(n-1)}{2} \mod 2$, since the number of elementary permutations in a reversal can just be counted as an arithmetic series (e.g. for '1234', '4' gets moved to the left three times, '3' two times, etc.)
Background: From Geometric algebra for Physicists, Chapter 2. There's an operator called 'reversion' defined in the text that reverses the elements of a wedge product. Since the wedge product is anti-commutative, the sign of the result is given by the parity of the permutation.
Let's study the values of $f$:
if $n=4k$, then $f(n)= (2k)(4k-1)= 0 \mod 2$.
if $n=4k+1$, then $f(n)= (4k+1)(2k) = 0 \mod 2$.
if $n=4k+2$, then $f(n)= (2k+1)(4k+1)= 1 \mod 2$.
if $n=4k+3$, then $f(n)= (4k+3)(2k+1)= 1 \mod 2$.