When teaching students about the Chinese remainder theorem, it is traditional to ask them questions like: "An integer $n$ is equivalent to $r_1 \bmod m_1$, to $r_2 \bmod m_2$ and to $r_3 \bmod m_3$. Compute $n \bmod m_1 m_2 m_3$." For example,
There are certain things whose number is unknown. If we count them by threes, we have two left over; by fives, we have three left over; and by sevens, two are left over. How many things are there? -- Sunzi Suanjing, 3rd century CE.
If it happens that $m_1 m_2 \equiv 1 \bmod m_3$, $m_1 m_3 \bmod m_2$ and $m_2 m_2 \bmod m_1$, then the question is particular easy to answer: One has $n = r_1 m_2 m_3 + r_2 m_1 m_3 + r_3 m_1 m_2$. I noticed this when preparing for my class today and planning to ask such a question with $(m_1, m_2, m_3) = (2,3,5)$, which has this property. Note that we can rewrite this property as $m_1 m_2 + m_1 m_3 + m_2 m_3 \equiv 1 \bmod m_1 m_2 m_3$.
So, for the fun of it, here is my question:
Can we describe all $k$-tuples of integers $(m_1, m_2, \ldots, m_k)$ such that $$m_1 m_2 \cdots m_{j-1} m_{j+1} \cdots m_k \equiv 1 \bmod m_j$$ for $1 \leq j \leq k$?