Proof of how to solve a specific type of congruence equation

RESOLVED

One of my questions is "Solve x=5 mod 2^400 and x=5 mod 3^400 " It's obvious that x = 5 mod 6^400 but could someone explain why? Normally I'd use the Chinese Remainder Theorem/Bezout's Lemma to solve these but with the large numbers this would be infeasible. Anyone care to explain an alternate way to solve this?

Posted Jan 14, 2018, 9:34 PM UTC

34
mtbarz•

That's probably the fastest way. CRT gives us that a unique solution exists, and clearly x = 5 mod 6^(400) works, so it must be the only solution. 'Guess and check' can often save time if you make the right guess, and here the guess is practically inescapable.

2
homura1650•

The above equalities are equivalent to x-5=0 mod 2^400 and x-5=0 mod 3^400.

That is to say, they are true iff x-5 is a multiple of both 2^400 and 3^400. Since these are relativly prime, we have LCM(2^400 , 3^400 ) = 6^400. So the equation are true whenever x-5 is a multiple of 6^400.

Returning to the language of modular congruence, they are true whenever x-5 = 0 mod 6^400 , which is x = 5 mod 6^400.

2
failedgamorOP•

Sweet, this helps a lot! Thanks! <3

1
bluegem2a•

To understand this, lets do a substitution, let u = x-5, then u = 0 mod 2^(400) and u = 0 mod 3^(400). This is true, according to the 4^(th) property on this list.

Okay, so u = 0 mod 2^(400). That means that u is a multiple of 2^(400). Same with 3^(400). That must mean that u is a multiple of the least common multiple or LCM of 2^(400) and 3^(400), which is 6^(400). I computed this because 2^(400) and 3^(400) are coprime, so their LCM is simply their product.

At this point, we have u = 0 mod 6^(400), so therefore x = 5 mod 6^(400).

I guess we can turn this into a formula. We can say that if x = y mod a and x = y mod b, then x = y mod LCM(a, b).

2