# Help Solving $m(m-1) \equiv 0 \pmod n$ [duplicate]

Is there a way to solve the equation $$m(m-1) \equiv 0 \pmod n$$ for $$1 < m < n$$? In this case, $$n$$ is known and I am solving for $$m$$. I am especially interested in either the highest or lowest value of $$m$$ given the listed bound, though finding any value works as well.

Edit: $$n$$ is not prime, nor is it a prime power ($$p^n$$ for prime $$p$$ and natural number $$n$$). I am also not interested in the trivial solutions ($$m = 0$$ and $$m = 1$$).

• If $n$ is prime, the only solution is $m=n-1$. – Leo Aug 24 '19 at 1:05
• @Leo Good point, I should add that $n$ is not prime, nor is it a prime power ($p^n$ for prime $p$ and natural number $n$). – GodOrGovern Aug 24 '19 at 1:10
• @Leo I had previously written $m(m+1)$ when I meant to write $m(m-1)$. I have since updated the post, which makes your comment appear incorrect, hence this clarification. – GodOrGovern Aug 24 '19 at 1:17