0

Given the equivalence $a^2 \equiv 1 \pmod b$ (where $b$ is known) is there an efficient way to determine if an answer other than $a = 1$ exists? Is there an efficient way to find the answer(s), especially the greatest possible value of $a$? The only constraint is $1 < a < b - 1$.

  • $b-1$ is another solution, and there's no other solution if $b$ is prime. Other than that, using the Chinese remainder theorem , it comes down to the case when $b is prime power. – Bernard Mar 15 '20 at 23:32
  • So $a \equiv_b -1$ is no good? – Mike Mar 15 '20 at 23:32
  • An answer with $1<a<b-1$ exists if and only if $b$ is a power of $2$ or has more than one prime factor; use the Chinese remainder theorem. – Servaes Mar 15 '20 at 23:33
  • 1
    @Servaes: a power of $2$ greater than $2^2$ – J. W. Tanner Mar 15 '20 at 23:40
  • @Servaes How would you apply the Chinese remainder theorem here? Sorry, I'm relatively inexperienced in this field – GodOrGovern Mar 15 '20 at 23:50
  • for example, $x^2\equiv1\bmod15\iff x^2\equiv1\bmod3\land x^2\equiv1\bmod5\iff x\equiv\pm1\bmod3\land x\equiv\pm1\bmod5$ – J. W. Tanner Mar 15 '20 at 23:54
  • Factor the modulus then apply CRT as in the linked dupe. There is nothing much faster than that because finding such nontrivial square roots is equivalent to splitting the modulus into nontrivial factors. If $,a>1$ is the least nontrivial square root then $,b-a\equiv -a,$ is the greatest root $\bmod b,,$ since the roots are closed under negation. – Bill Dubuque Mar 15 '20 at 23:59

0 Answers0