Question 122For any positive integer $n$ denote by $f(n)$ the smallest positive integer $m$ such that the sum $1+2+\cdots+m$ is divisible by $n$. Find all $n$ such that $f(n)=n-1$.