1

[Update: the equation was originally $\,y^{x^2}\equiv a\,$ but was changed to $\,y\cdot x^2\equiv a\,$ --Bill]

How do I solve for the answers of an equation of the following form, i haven't seen one in this form in my searches:

$$-352157 * (x^2) = 1 \mod 1022117$$

https://www.dcode.fr/modular-equation-solver#q2 lists the answers for $x$ as:

$$(118188, 461248, 5600869, 903929)$$

Whenever I solve equations of this form, I get four answers, and am looking for guidance on how to solve these. Is this an application of the Tonelli-Shanks algorithm that works here? Especially of interest to me are the two center numbers. The last answer seems to be just $1022117 - 118188$ which equals $903929$. Any help would be appreciated.

Bill Dubuque
  • 272,048
  • It's true iff $x^2$ is divisible by the order $n$ of $-352157 \pmod {1022117}$. What part of that do you have trouble with? – Bill Dubuque Oct 30 '21 at 20:52
  • @BillDubuque Bill, when i try that i get different answers. If you have a few minutes to spare, can you elaborate or point me to a resource on how to do this? I would very much appreciate it. – oppressionslayer Oct 30 '21 at 22:30
  • What is your value of the order $n$? Do you know how to solve $,n\mid x^2,?\ \ $ – Bill Dubuque Oct 30 '21 at 23:10
  • Your edit changed the operation from exponentiation to product, which makes the above comments meaningless. Is you equation $,b x^2\equiv a,$ or the original $,b^{x^2}\equiv a?, $ The former is solved by a modular inversion and sqrt, e.g. by Shanks Tonelli. – Bill Dubuque Oct 30 '21 at 23:11
  • Your 2nd last sentence is explained by the fact that if $r$ is one square-root then so too is $-r,,$ since $(-r)^2\equiv r^2.\ $ Note $,-r\equiv n-r\pmod{n}\ \ $ – Bill Dubuque Oct 30 '21 at 23:20
  • Here is the method: compute the two square roots of $A/y$ for each prime modulus (e.g. by Shanks) then lift the 4 possible combination of the roots to the product of the moduli by CRT - as explained in the linked dupes (I included also a general quadratic solution in the 3rd link). – Bill Dubuque Oct 30 '21 at 23:29
  • @BillDubuque Ok, so i can solve for the first and last number, 118188 and 903929. Can i derive the middle two numbers with just those and the number i used to derive those from? I looked at the links, but something is missing, i just need to know how to derive the center two numbers or need some help to guide me. Thx again for your time. – oppressionslayer Oct 31 '21 at 01:41
  • Nothing is missing. The roots are $,\pm 135\bmod 1009,$ and $,\pm 333\bmod 1013$. By CRT these lift to $(135,-333)\bmod (1009,1013)\to 118188\bmod 1022117,,$ hence its negative $(-135,333)\to -118188 \equiv 903929\bmod 1022117;,$ similarly $,(135,333)\to 461248,,$ with negative $(-135,-333)\to -461248\equiv 560869.,$ It's better to first grok the smaller examples in the dupes. – Bill Dubuque Oct 31 '21 at 04:52
  • @BillDubuque Thank you so much, this helps immensely. My nderstanding then is that you need to know the factors, otherwise you can't figure out those two middle numbers, is that 100% correct? Also can you let me know how to find the 135 and 333 numbers. I promise this is the last question, and thank you so much for helping me out. – oppressionslayer Nov 01 '21 at 21:48
  • It's equivalent to factoring, e.g. see here and here – Bill Dubuque Nov 01 '21 at 22:44
  • @BillDubuque You are amazing, you helped me figure this out completely, i can't thank you enough! – oppressionslayer Nov 02 '21 at 19:41
  • Great - glad I could help. – Bill Dubuque Nov 02 '21 at 19:45
  • @BillDubuque i hope you have time for a very simple question, how (what equation) did you derive the roots of (±135, ±333) for this equation. Once again i really appreciate it if you could reference how to do that. Thanks again. – oppressionslayer Nov 20 '21 at 16:46

0 Answers0