While messing with modulus in python,
lomod = [num % 27 for num in [i * 8 for i in range(27)]]
print('Unsorted:', lomod)
lomod.sort()
print('Sorted:', lomod)
I found something interesting.
For $a,b\in\mathbb{Z}$, and $a,b$ are relatively prime, and $0 \le x < b$, $A =ax\mod b$, then $A = \{0,1...,b-1\}$ with no repeating integers.
For example in the case of $a = 8, b=27$, for values of $x$ such that $0\le x < 27$
$A =8x\mod27$ , then
$A =$ [0, 8, 16, 24, 5, 13, 21, 2, 10, 18, 26, 7, 15, 23, 4, 12, 20, 1, 9, 17, 25, 6, 14, 22, 3, 11, 19]
sorted,
$A =$ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
Which contains all values from $0$ to $26$ once.
However, I don't know how to prove this generally. Is there anyone that can help me?