4

I just solved a question from a mathematical competition, which asked to find all positive integers $n$ such that $$\left(\frac{n(n+1)}{2}\right)^2 \equiv 17 \pmod {(n+5)}.$$ We know $n\equiv -5 \pmod {(n+5)}$, so this simplifies to $$332 \equiv 0 \pmod {(n+5)}.$$

The values of $n$ that solve this that are larger than $0$ are $78, 161,327$ however only $78$ and $161$ work in the original equation. My question is, if all the steps are logically valid, why would not all the solutions work? Why does the last value of $n$ not work in the original equation?

lulu
  • 70,402
  • 3
    Division by $2$ in a congruence with an even modulus is problematic. Note that if you just simplified the left hand without first cross multiplying by $4$ you'd get $100\equiv 17\pmod {(n+5)}$ which only has $n=78$ as a solution. – lulu Nov 07 '23 at 12:10
  • 1
    For an even odder oddity, try to solve the same problem replacing $17$ by $100$. – lulu Nov 07 '23 at 12:19
  • I don't know if this is a duplicate so I won't be answering this question unless enough people are confident it's not. The point is, you start off by saying that $n \equiv -5 \pmod{n+5}$, and then substituting that into the congruence to obtain $\left(\frac{n(n+1)}{2}\right)^2 \equiv 100 \pmod{n+5}$. The point is, there could be another integer $m$ such that $\left(\frac{m(m+1)}{2}\right)^2 \equiv 100 \pmod{n+5}$, basically because that equation is quadratic and one should expect two solutions. Indeed, $327$ is such a solution. So it's between these steps that you created a solution. – Sarvesh Ravichandran Iyer Nov 07 '23 at 12:50
  • You scaled the congruence by $4$ which is a noninvertible operation when the modulus is even, so it may introduce extraneous candidate solutions, so you need to check that the candidate solutions are are actual solutions - see here in the linked dupe. – Bill Dubuque Nov 07 '23 at 15:12

0 Answers0