0

Solving $x^2 \equiv 3 \pmod{2003}$

I think it is like solving $x^2 \equiv 2006 \pmod{2003}$ because $2006 \equiv 3 \pmod{2003}$. The possible value for $x$ are from $1$ to $2002$, so I can just insert $x$ to check until I get the right answers, but that only works for small modulo, this modulo is very big, which is impossible to check from $1$ to $2002$. Any hints to solve this equation? Thanks!

  • 1
    I don't understand what you would gain from replacing $3$ by $2006$ here – pancini Jan 06 '21 at 05:47
  • That's the only thing I can think of when trying to solve this equation. –  Jan 06 '21 at 05:48
  • 1
    Checking $2000$ or so possibilities for a simple expression is well within the range of a spreadsheet, not to mention any programming language. In a spreadsheet, make a column with the numbers from $1$ to $2003$ In the next column reduce the square $\bmod 2003$. Copy down makes it easy. Changing to $2006$ adds nothing here, as the square could be much larger. – Ross Millikan Jan 06 '21 at 05:49
  • Thanks for your reply! But are there any ways to solve it by hand? –  Jan 06 '21 at 05:52
  • Easy by Lagrange, cf. this answer in the dupe. – Bill Dubuque Jan 06 '21 at 09:09

2 Answers2

3

Parcly has correctly deduced that $3^{501}$ will be a solution, and now we show how this can be reduced by hand. Note that $3^{512} = 6561^{64} \equiv 552^{64} = 204704^{32} \equiv 248^{32} = \dots = 555 \mod 2003.$

Now $3|2004,$ so we obtain $t = 3^{-1} = 2004/3 = 668 \mod 2003.$ Lastly, another round of repeated squaring using $11_{10} = 1011_2$ gives $t^{11} \equiv -524 \mod 2003.$

Thus, at last $3^{501} \equiv 3^{512} \cdot t^{11} \equiv 555 \cdot -524 = -290820 \equiv -385 \mod 2003.$

Display name
  • 5,310
1

Lucky for you, $2003$ is a prime $\equiv3\bmod4$. If a solution $x$ exists, $x\equiv\pm3^{(2003+1)/4}\bmod2003$. We compute the modular exponent as $385\bmod2003$, which indeed squares to $3\bmod2003$. So $x\equiv\pm385\bmod2003$.

Parcly Taxel
  • 105,904
  • 1
    $3^{501}$ can't be computed by hand. If he has to use computer, he can anyway run a loop to solve it. – Martund Jan 06 '21 at 05:51
  • 2
    @Martund Repeated squaring, just simply use the binary representation of $501.$ Even better, compute $3^{512}$ with a quick repeated square, then find $t = 3^{-1}$ easily and compute $t^{11}.$ – Display name Jan 06 '21 at 05:52
  • @Displayname, still that is very time consuming to solve it by hand, $3^{501}$ has around $240$ digits! – Martund Jan 06 '21 at 05:55
  • 1
    @Martund Repeated squaring means you will never go above 6 digits in the process of calculation. I will add an answer demonstrating the process. – Display name Jan 06 '21 at 05:56
  • $2003$ is a prime $\equiv 3 \pmod 4$, If a solution $x$ exists, $x\equiv\pm3^{(2003+1)/4}\pmod{2003}$. How can you think of this? –  Jan 06 '21 at 05:57
  • Ok I got you, you are taking residue modulo 2003 every time you square? @Displayname – Martund Jan 06 '21 at 05:57
  • @Martund $3^{501}=(((((3^2)^2)^5)^5)^5)3$ – Parcly Taxel Jan 06 '21 at 05:58
  • @Angry See the note on $3\bmod4$ primes here. – Parcly Taxel Jan 06 '21 at 06:03
  • 1
    @Angry By Fermat's Little Theorem $3^{2003-1}\equiv1\pmod{2003}$ so $3^{2003+1}\equiv1\cdot9=9\pmod{2003}$. This would imply $3^{\frac{2003+1}2}\equiv3\pmod{2003}$ and $\left(3^{\frac{2003+1}4}\right)^2\equiv3\pmod{2003}$. – Kyan Cheung Jan 06 '21 at 06:06
  • $3^{2003}\equiv 3 \mod (2003)$ ; . $3^{2004}\equiv 3^2 \ mod (2003)$; so: $3^{1002}\equiv 3\mod (2003)$ finaly : $(3^{501})^2\equiv 3 \mod (2003)$ – sirous Jan 06 '21 at 07:29