Is there a way to find the original multiples of a modular operation?

49 Views Asked by At

$$7 \times 14 \mod 10 = 8$$

Is there a theorem or procedure that optimizes a way to find 7 and 14 given 8 and mod 10?

Brute force is the obvious approach here, such as finding all multiples of 8, then 8 + 10, then 8 + 20, etc. but it seems like there ought to be a way to derive this without brute force.

Edit

Expanding on this a little.

What do you want 7 and 14 to satisfy?

Lets say I have a way of knowing when the right numbers are found. I have equations that I can plug candidates into to determine if they are the original multiples.

Also, this example is greatly simplified. I'm actually dealing with 256-bit numbers that are very large with a 256-bit mod, so any sort of brute force that involves incriminating by mod is impracticable.

It's very likely the large numbers that 7 and 14 represent are co-prime, so any sort of enumeration that yields candidates (that satisfy the equation) will have such a small search space that it might be practical. But this only works if each iteration produces a valid set and the effort of producing the sets are $O(n)$.

For example, the source code of the Extended Euclidean algorithm enumerates with a valid set of numbers each cycle.

Is there an equivalent function that can perform some operation each cycle to produce valid numbers that satisfy $x \times y \mod 10 = 8$ that I can loop through until I find the numbers that satisfy my other verification equations?