What Determines the Existence of Solutions for Quadratic Residues Modulo N?

  • Thread starter jostpuur
  • Start date
In summary, the conversation discussed the problem of solving for x in the equation y=x^2 mod N, where N and y are fixed values. It was noted that for small values of N, there is no clear pattern, but for prime N, there is an algorithm. The concept of quadratic residues was also mentioned, with it being noted that every integer is a quadratic residue modulo 2 and that for an odd prime number p, there are (p+1)/2 residues and (p-1)/2 nonresidues. The use of Euler's criterion for determining solutions was also mentioned.
  • #1
jostpuur
2,116
19
Suppose [itex]N=1,2,3,\ldots[/itex] and [itex]y=0,1,2,\ldots, N-1[/itex] are fixed. How do solve [itex]x[/itex] out of

[tex]
y=x^2\quad \textrm{mod}\quad N ?
[/tex]

I went through some of the smallest values for [itex]N[/itex] and all [itex]y[/itex], and I could not see a pattern. For example, if [itex]N=5[/itex], then at least one [itex][x][/itex] exists if [itex][y]=[0],[1][/itex] or [itex][4][/itex], but no solution [itex][x][/itex] exists if [itex][y]=[2][/itex] or [itex][3][/itex]. You can produce similar result for other small [itex]N[/itex] with finite amount of work, but I failed to see a pattern that I could try to generalize.
 
Mathematics news on Phys.org
  • #2
For prime N, there is an algorithm. The article also has a link for the other cases.
 
  • #3
You're talking about quadratic residues.
Modulo 2, every integer is a quadratic residue.

Modulo an odd prime number p there are (p + 1)/2 residues (including 0) and (p − 1)/2 nonresidues. In this case, it is customary to consider 0 as a special case

Edit to add: If you just want to determine whether a given k is a solution to ##k \equiv x^2 \text{ mod } p##, for ##p## prime, you can use Euler's criterion: ##k^\frac{p-1}{2} \equiv 1 \text{ mod } p##
 
Last edited:

Related to What Determines the Existence of Solutions for Quadratic Residues Modulo N?

What does "mod" mean in the equation y=x^2 mod N?

In mathematics, "mod" stands for modulo, which is the remainder when one number is divided by another. In this equation, it means that the value of y is the remainder when x^2 is divided by N.

Why is it important to use modular arithmetic in solving this equation?

Modular arithmetic allows us to handle very large numbers efficiently, making it useful in various fields such as cryptography and number theory. In the equation y=x^2 mod N, using modular arithmetic ensures that the resulting value of y is always within a certain range, making it easier to work with.

What is the process for solving y=x^2 mod N?

The first step is to calculate x^2. Then, divide x^2 by N and find the remainder, which is the value of y. This can be done using a calculator or by hand. Alternatively, you can use the formula y = x^2 - N * floor(x^2 / N), where floor() represents the floor function.

What are the possible values of y in this equation?

The possible values of y can range from 0 to N-1. This is because the remainder when divided by N can never be greater than N-1. In other words, the value of y must be less than the divisor N.

Can this equation be solved for complex numbers?

Yes, this equation can be solved for complex numbers. However, the result may not be a real number. For example, if N=2, the equation y=x^2 mod 2 has the solutions x=0 and x=1, which are both real numbers. But if N=3, the solutions are x=0, x=1, and x=2, which are all complex numbers.

Similar threads

Back
Top