What are some of the simplest known bijections in $\mathbb{Z}/n\mathbb{Z}$?
Offhand, the following classes of primitive bijections come to mind:
- Addition/subtraction (+/–) of any constant
- Multiplication ($\times$) by an odd constant (and division of course by multiplicative inverse)
- Bitwise exclusive-or ($\oplus$) with any constant, or equivalently any inversion ($\lnot$) of specific bits
- Rotary bit-shifting ($\ll$, $\gg$ with wrap-around)
and the following slightly-more-complex bijections:
- Bit-reversal (reverse the ordering of bits in a number)
- In general, any permuted mapping of the base-2 digits (bits) of a number — for example swapping two bits
- Any maximal-length LFSR (Linear Feedback Shift Register) function
and of course the most general bijection:
- Any permutation in $\mathbb{Z}/n\mathbb{Z}$
But I'm really most interested in the simplest bijections — that is, functions generally involving a single integer rather than a set of integers (multiplication, addition, exclusive-or, etc. all fit this).
The reason I’m interested is because I want to devise pseudorandom permutations in $\mathbb{Z}/n\mathbb{Z}$ by composing simple arithmetic functions.
So far, I’ve determined that permuting values in $\{0, \ldots, 2^{64}-1\}$ via 4 rounds of multiplication, addition, and bit-reversal (of randomly chosen multipliers and addends) for the case of $n=2^{64}$ is sufficient to pass PractRand for a few trillions of values, which is good for my purposes — but I'm just wondering if there are simpler formulations that produce random-looking permutations.