Search code examples
cryptographymodulomathematical-optimization

Modulo expression arithmetic equation


how do i solve: (2a^2-195)mod26=1

I have tried the next way: x=(2a^2-195) and if x mod26=1 then x=27,53,79,105.... but could not find an answer, how can i solve this mathematically?

Thank you!


Solution

  • Well, 2a²-195 = 1 (26) is the same as
    2a² = 196 (26) <==> 2a² = 14 (26) <==> a² = 7 (13).

    I'm sure you can take it from there...


    Spoiler: no value of a satisfies the congruence since 7 is not a square mod 13. You can check this fact by calculating 7⁶ and finding that 7⁶ = -1 (13), or by enumerating the squares mod 13 (there are six: 1, 4, 9, 3, 12 and 10) and observing that 7 is not in the list.

    You could have found there are no solutions also by testing the original equation with a = 0, 1, .., 25. None of them satisfy the congruence, and you arrive at the same conclusion.