14. N1 (JAP) Determine all positive integers $n \geq 2$ that satisfy the following condition: For all integers $a, b$ relatively prime to $n$, $a \equiv b(\bmod n) \quad$ if and only if $\quad a b \equiv 1(\bmod n)$.
14. The given condition is obviously equivalent to $a^{2} \equiv 1(\bmod n)$ for all integers a coprime to $n$. Let $n=p_{1}^{\alpha_{1}} p_{2}^{\alpha_{2}} \cdots p_{k}^{\alpha_{k}}$ be the factorization of $n$ onto primes. Since by the Chinese remainder theorem the numbers coprime to $n$ can give any remainder modulo $p_{i}^{\alpha_{4}}$ except 0 , our condition is equivalent to $a^{2} \equiv 1\left(\bmod p_{i}^{a_{i}}\right)$ for all $i$ and integers $a$ coprime to $p_{i}$.
Now if $p_{i} \geq 3$, we have $2^{2} \equiv 1\left(\bmod p_{i}^{a_{i}}\right)$, so $p_{i}=3$ and $\alpha_{i}=2$. If $p_{j}=2$, then $3^{2} \equiv 1\left(\bmod 2^{\alpha_{j}}\right)$ implies $\alpha_{j} \leq 3$. Hence $n$ is a divisor of $2^{3} \cdot 3=24$. Conversely, each $n \mid 24$ has the desired property.