0

Using Legendre's symbol, knowing that $41 \equiv 1 \pmod{4}$ we can solve said equation. Then, I looked at the residue classes and I just counted my way to the solution $x = 9$. Verifying, $9^2 = 81$ and $81 \equiv -1 \pmod{41} $. I was wondering if there was an actual way to solve the equation $$x^2+1 \equiv 0 \pmod{41}$$ using quadratic residue formulas or any other formula for that matter, instead of counting to get the solution.

  • 1
    I think you mean $41\equiv 1 \pmod 4$ in your first line. Beyond that, I don't know what you are asking. – lulu Feb 16 '21 at 22:09
  • One possible approach which does rely on some random guessing, but not nearly as much: start with some random $a \not\equiv 0 \pmod{41}$, such as $a = 2$. Then, since we know $a^{40} \equiv 1 \pmod{41}$, we can examine $a^5, a^{10}, a^{20}, a^{40}$ and if $a^5 \not\equiv \pm 1 \pmod{41}$, then one of those numbers will be equivalent to -1 (that's what has to happen just before reaching 1), and the number before that will be the desired square root. – Daniel Schepler Feb 16 '21 at 22:14
  • 1
    Please include the question you are asking in the body of the post, not just in the subject line. – Arturo Magidin Feb 16 '21 at 22:16
  • @DanielSchepler Well....you might get unlucky and start with say, $a=16$ which has order $5\pmod {41}$. – lulu Feb 16 '21 at 22:17
  • I have edited my post, I think it is clearer now – Rodrigoss Feb 16 '21 at 22:20
  • 1
    There's the Tonelli Shanks algorithm: https://en.wikipedia.org/wiki/Tonelli–Shanks_algorithm It emulates Newton's method for finding roots of functions. – B. Goddard Feb 16 '21 at 22:24
  • @lulu Well, that's where the random guessing comes in - if you get unlucky then you make another random guess. Then, since $a^5 \equiv \pm 1 \pmod{41}$ has only 10 solutions, the probability of a random guess leading to a solution is $\frac{3}{4}$. – Daniel Schepler Feb 16 '21 at 22:27
  • So let's make it more interesting and solve $x^2+1\equiv 0 \bmod 4441$. :-) – Joffan Feb 16 '21 at 22:42
  • See https://math.stackexchange.com/q/5877/207316 – PM 2Ring Feb 16 '21 at 22:47
  • With very small primes it is quick to write as the sum of two squares, $41= 25+16v = 5^2+4^2$ in my head. Therefore $\left(\frac{4}{5}\right)^2 \equiv -1 \pmod {41},$ and we have easy modular reciprocals for 4,5 as needed to proceed. I guess I put 5 in the denominator, $5 \cdot (-8) \equiv 5 \cdot 33 \equiv 1 \pmod{41}.$ So the fraction becomes $4 \cdot 33 = 132 \equiv 9 \pmod {41}$ – Will Jagy Feb 16 '21 at 22:55
  • $4441=60^2+29^2$ and $29 \cdot 1072 \equiv 1 \pmod {4441}$ Then $60 \cdot 1072 \equiv 2146 \pmod {4441}.$ Note that 2146 is the number of my post office box. And $2146^2 \equiv 4440 \pmod {4441}$ – Will Jagy Feb 16 '21 at 23:08
  • 1
    Here's a live version of Robin Chapman's script, trimmed to just compute sqrt(-1) mod p. – PM 2Ring Feb 16 '21 at 23:51
  • 2
    @PM2Ring And here is Macsyma code, along with a proof. – Bill Dubuque Feb 17 '21 at 09:20

1 Answers1

2

If $p$ is a prime, and $p\equiv 1\pmod{4}$, then we can express $p$ as the sum of two squares: $p=x^2+y^2$. Then you have $x^2\equiv -y^2\pmod{p}$, and since $\gcd(y,p)=1$, you can find $z$ such that $zy\equiv 1\pmod{p}$. Then $(xz)^2 = x^2z^2 \equiv -y^2z^2 = -1\pmod{p}$.

Here, $41=5^2+4^2$. Now, $4(10)=40\equiv -1\pmod{41}$, so $4(-10)\equiv 1\pmod{41}$. Thus, one solution is $5(-10)= -50\equiv 9\pmod{41}$.


Of course, part of this is cheating, since one way to establish that a prime $p$ can be written as a sum of two squares when $p\equiv 1\pmod{4}$ is to rely on the fact that the equation $x^2\equiv -1\pmod{p}$ has a solution.

Arturo Magidin
  • 398,050