Background: I came up with this trying to answer an actually silly question of "when can $1+1=3$ be true" ?
Consider a set $\mathcal S = \{0,\cdots, N-1\}$ coupled with an operation "+" that takes any pair of elements $a,b\in\mathcal S$
$$a+b \to \text{mod}(N-\text{mod}(a+b,N),N)$$
In other words like a cyclic group but after the rotation a reflection is carried out.
My question is: can we classify what I have constructed?
If we analyze the group axioms
- Closure is trivial to prove.
- Inverse element is easy to assign, for $s$ just pick $N-s$, the rotation takes us to $0$ and the subsequent reflection does not move $0$ anywhere.
- Identity element is much trickier. $0+0 = 0$, but for any $s+0$, this will not be $s$.
However, applied twice, it will act as identity $s+0+0 = s$ as we will reflect back again.
So in the language of abstract algebra, what have I done!?
I will let $a\oplus b $ denote $N-\text{mod}(a+b,N)$. This operation is not even associative, as $$(s\oplus0)\oplus0=s\ne N-s=s\oplus0=s\oplus(0\oplus0)$$ Actually, it is a commutative quasigroup, which is a magma with the Latin square property. Let's check the axioms:
By the way, $N-x$ is not the inverse of $x$, because $0$ is not an identity.