Instead of computing large terms in the arithmetic progression, the trick computes the sequence of remainders modulo the new target modulus. It starts with the current solution's remainder and repeatedly adds the step size's remainder modulo the target, stopping when the target remainder is reached.
Conditions: You have an arithmetic progression of candidates satisfying previous congruences.; You need to find the first term satisfying a new congruence x ≡ r (mod m).
Instead of computing large terms in the arithmetic progression, the trick computes the sequence of remainders modulo the new target modulus. It starts with the current solution's remainder and repeatedly adds the step size's remainder modulo the target, stopping when the target remainder is reached.
Conditions: You have an arithmetic progression of candidates satisfying previous congruences.; You need to find the first term satisfying a new congruence x ≡ r (mod m).