Remainder Number Finder


Solve a set of integer remainder conditions with the generalized Chinese remainder theorem, including compatible non-coprime divisors.

Use consistent units. Enter numbers without thousands separators. Invalid input clears all results.

값을 입력하세요:

1 to 12 positive integers, each at most 1e9.

Each remainder must be 0 or more and less than its divisor.

결과:

Inputs and results

Choose the matching mode, then read each field label and note. Results use the same length, time, currency or quantity units as the inputs unless a label says otherwise. A negative change means a decrease.

Formula

Each condition is N ≡ ri (mod di). Two conditions can be combined only if the difference of their remainders is divisible by gcd(d1,d2). Compatible conditions produce a single solution class modulo lcm(d1,d2). Extended Euclid finds the modular inverse needed at each merge.

Worked example

N leaves remainders 2, 3 and 2 modulo 3, 5 and 7. N = 23 works: 23 = 3×7+2 = 5×4+3 = 7×3+2. The repeat period is 105, so all integer solutions are 23+105k.

Limits and edge cases

This page distinguishes the least nonnegative answer from the least positive one. All-zero remainders give 0 as the first and the LCM as the second. Integers are exact through BigInt after strict bounded input parsing. Inconsistent systems return an error, not a numeric answer. Decimal calculations use floating-point arithmetic; displayed values are rounded to 12 significant digits. This is an educational tool, not a guarantee about investments or physical systems.

FAQ

Must the divisors be co-prime?

No, but shared factors impose compatibility requirements.

Are negative remainders accepted?

No. Enter the standard remainder between zero and divisor minus one.

Formula reference

Background mathematics. Explanation and examples on this page are independently written.