2

Can we find square root modulo prime p

by long division method As we do with decemal number

1 Answers1

1

I know of no similar method. To find a square root of $a$ mod $p$, supposing you've checked $a$ does have a square root, there are two cases:

  • if $p\equiv 3\mod 4$, the square roots are $\;\pm a^{\tfrac{p+1}4}$.
  • if $p\equiv 1\mod 4$, it is much more complex and can be perform with the Tonelli-Shanks algorithm.

However, it may happen the first step of the algorithm yields the square roots, so you can at least try to perform this (simple) first step:

We have $p-1\equiv 0\mod 4$, so write $p-1=2^e s$, where $e\ge 2\,$ and $s$ is odd. If $a^s\equiv 1\mod p$, the square roots are $\;\pm a^{\tfrac{s+1}2}$.

Bernard
  • 175,478