Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Maybe I am missing something, but the function $\frac{x+y}{2}$ doesn't form a Latin square. $(2k + 2) \cdot \frac{x+y}{2} \text{ mod } 2k + 1 = (k +1)(x+y) \text{ mod } 2k + 1$, however, does.