How can we efficiently find square root of 5 in a mod prime field. By quadratic reciprocity we can argue that 5 is a square in modulo p(prime) is p is square modulo 5. But how exactly can we calculate it.
2026-04-01 11:18:10.1775042290
Square root of 5 in modulo prime field
1.6k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There are 1 best solutions below
Related Questions in NUMBER-THEORY
- Maximum number of guaranteed coins to get in a "30 coins in 3 boxes" puzzle
- Interesting number theoretical game
- Show that $(x,y,z)$ is a primitive Pythagorean triple then either $x$ or $y$ is divisible by $3$.
- About polynomial value being perfect power.
- Name of Theorem for Coloring of $\{1, \dots, n\}$
- Reciprocal-totient function, in term of the totient function?
- What is the smallest integer $N>2$, such that $x^5+y^5 = N$ has a rational solution?
- Integer from base 10 to base 2
- How do I show that any natural number of this expression is a natural linear combination?
- Counting the number of solutions of the congruence $x^k\equiv h$ (mod q)
Related Questions in MODULAR-ARITHMETIC
- How do I find the least x that satisfies this congruence properties?
- Counting the number of solutions of the congruence $x^k\equiv h$ (mod q)
- Remainder of $22!$ upon division with $23$?
- Does increasing the modulo decrease collisions?
- Congruence equation ...
- Reducing products in modular arithmetic
- Product of sums of all subsets mod $k$?
- Lack of clarity over modular arithmetic notation
- How to prove infinitely many integer triples $x,y,z$ such that $x^2 + y^2 + z^2$ is divisible by $(x + y +z)$
- Can $\mathbb{Z}_2$ be constructed as the closure of $4\mathbb{Z}+1$?
Related Questions in CONGRUENCES
- How do I find the least x that satisfies this congruence properties?
- Counting the number of solutions of the congruence $x^k\equiv h$ (mod q)
- Considering a prime $p$ of the form $4k+3$. Show that for any pair of integers $(a,b)$, we can get $k,l$ having these properties
- Congruence equation ...
- Reducing products in modular arithmetic
- Can you apply CRT to the congruence $84x ≡ 68$ $(mod$ $400)$?
- Solving a linear system of congruences
- Computing admissible integers for the Atanassov-Halton sequence
- How to prove the congruency of these triangles
- Proof congruence identity modulo $p$: $2^2\cdot4^2\cdot\dots\cdot(p-3)^2\cdot(p-1)^2 \equiv (-1)^{\frac{1}{2}(p+1)}\mod{p}$
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
One way to approach this is to note that $5$ has a square root only in primes of the form $5n\pm 1$, and that half of these 5 will have an odd period (ie 11, 19 mod 20).
For all primes of the form $p = 5n\pm 1$, 5 has a square root. It also means, that where $5^\lambda=1 \pmod p$, then $\frac{p-1}\lambda$ is even. We don't need to evaluate $\lambda$, but to simply note that if $\frac{p-1}2$ is odd, then $\frac{p+1}2$ is even. We note further, that $5^{\frac{p+1}2}=5 \pmod p$, and hence $5^{\frac{p+1}4}=\sqrt{5} \pmod p$. For primes of the form $p=11, 19 \pmod {20}$, then $\frac{p-1}2$ is odd, and this process suffices to find the square root directly.
The trick for $p=11, 19 \pmod {20}$, is that $p$ has a period of odd length in base $5$, and so if $p \mid 5^o - 1$, then $p \mid 5^{o+1} - 5$, Since $o+1$ is even, its half must give the square root of 5 directly.
For example, with 11, we see that $5^{\frac {11+1}4}$ gives $5^3=4 \pmod{11}$, where $4^2 = 5$. Likewise, with $19$, $5^{\frac{19+1}{4}}=3125 = 9 \pmod{19}$, and $9^2 = 5 \pmod{19}$.
It will work for the others at varying random levels (a reasonable probability, indeed), and is certianly worth the shot before trying something fancier, like hunting down some $x^2=5$. For example, it works with $p=1, 9 \pmod{20}$ with a fair direct hit rate, and is certianly worth the try before other methods are called for.
For primes of the $p=1,9 \pmod{20}$, one assumes first an odd period, so one divides out all of the powers of $2$ in $p-1$, and add 1, and divide that by $2$, to find the power to try. For example, with $3121$, then $3120$ gives $16\cdot 195$, and $(195+1)/2 = 98$. If it does not work for $98$, then you have to hunt it down some other way.
For example, with $3121$, one finds that $5^{98} = 256 \pmod{3121}$, and that $256^2 = -5 \pmod{3121}$. While it's not $+5$, it is much easier to hunt down $a^n=-1 \pmod p$, and thus this would give a fast solution.
This one works on where primes of the form $p = 4n+1$ (n odd). Since the period in base 5 divides 2n, then $5^n = \pm 1$, and $5^{n+1}=\pm 5$. So it is square root is $5^{(n+1)/2} = \sqrt{\pm 5}$. It follows also that $2^n = \sqrt{-1}$ always, so we can calculate $\sqrt{5}$ directly.
In fact, for $p=21, 29 \pmod{40}$, raising $ 5^{((p+3)/8)} = \sqrt{\pm 5} \pmod p$ will give either a direct hit, or failing that multiply it by $\sqrt{-1} = 2^{\frac {p-1}4} \pmod p$ will get the answer.
example: for $p=229$, we get $5^{29} = 192$, $192^2 = 224 = -5$. We need to find the square root of $-1$, by $2^{228/4}$, gives $122$, and $122 \cdot 192 = 66$, where $66^2 = 5$.
There are perfectly general ways for handling the remaining cases modulo 1, by using a curious trick i devised some years ago. It runs in pretty much logrithmic time too.
For $p = 40n + 1$ or $40n +9$, you can use isopowers, of the form $a\mbox{^^}(n/5)$, where a = 40n or a=40n+10.
One is seeking from the following algorithm, a value of a, for which $a\mbox{^^}n = 2$, and $a \mbox{^^}(n/5)=b$ isn't. This gives a value of b, for which $b+b+1 = \sqrt{5}$.
The algorithm runs like this. This example shows the finding of x^37, modulo p. The values in cols a0, a1 are direct integers, (eg 37), while the remainder of the columns give $t(n)$. The iteration is $a_2 <- a_2^2 - 2$, and $a_5 = a_2 * a_4 - a_3$, and a_6 = a_5 * a_2 - a_4. These are carried down, as $a_3, a_4 <- a_3, a_5 or a_4, a_6. It runs at 2/3 of the speed of exponent powers.
For primes of the form 40n + 1, put k= 8n, For primes of the form 40n+9, put k=8n+2.
Start with a=3, and seek first $a\mbox{^^}(5k)=2$. If this works, then see if some $b=a \mbox{^^}k \ne 2$. Then, the square root of 5 is $2b+1$.