Elysia Tools

Browse tools, examples, visual explainers, and topic guides from one clear workspace.

Top Categories

Hubs

Language
ZHDERUPTENFRES

Elysia Tools

Navigation

Math & Numbers

Chinese Remainder Theorem Solver (System of Congruences)

· Last updated:2026-08-27

Generalized pairwise-merge CRT for 2–20 congruences: coprime moduli give the product modulus, consistent non-coprime moduli give the lcm, inconsistent systems are rejected.

Execution

Run this tool

Fill in the form, run the tool, and review the result in one place.

Samples

Examples that match this tool

Related

Continue with connected tools and hubs

Written by the Elysia Tools team

Tool usage guide

Learn when to use this tool, what it supports, and how real users apply it.

Key facts

Category
Math & Numbers
Input types
text
Output type
text
Sample coverage
4
API ready
Yes

Overview

The Chinese Remainder Theorem Solver calculates the unique integer solution for systems of 2 to 20 simultaneous congruences using generalized pairwise merging. It handles both pairwise coprime moduli and consistent non-coprime moduli by computing the least common multiple (LCM), while identifying and rejecting contradictory systems.

When to use

  • Solving classic modular arithmetic and number theory problems involving simultaneous remainder conditions.
  • Merging non-coprime modular systems where consistency depends on greatest common divisor compatibility.
  • Verifying step-by-step solutions for cryptography, modular scheduling, or discrete mathematics coursework.

How it works

  1. 1Enter the list of remainders and corresponding moduli as comma- or space-separated values.
  2. 2The solver processes equations sequentially using pairwise merging to compute intermediate remainders and moduli.
  3. 3For coprime moduli, it combines them via their product; for non-coprime moduli, it verifies consistency using the greatest common divisor and combines them via the least common multiple.
  4. 4The tool outputs the unique solution x in the interval [0, M) along with a verification check for each original congruence.

Use cases

  • Solving classical Chinese Remainder Theorem word problems from discrete mathematics and ancient puzzles.
  • Determining periodic synchronization cycles when two or more cyclic events repeat with offset starting times.
  • Validating modular arithmetic steps in RSA key operations and cryptographic congruence calculations.

Examples

1. Sunzi's Classic Puzzle

Mathematics Student

Background

A student needs to solve the historical Sunzi problem where dividing by 3 leaves remainder 2, dividing by 5 leaves remainder 3, and dividing by 7 leaves remainder 2.

Problem

Calculate the smallest positive integer that satisfies all three modular constraints simultaneously.

How to use

Enter `2, 3, 2` in the Remainders field and `3, 5, 7` in the Moduli field.

Remainders: 2, 3, 2 | Moduli: 3, 5, 7

Outcome

Finds the combined modulus M = 105 and the unique solution x = 23 with step-by-step verification.

2. Merging Non-Coprime Moduli

Computer Science Instructor

Background

An instructor wants to demonstrate how generalized CRT handles congruences with shared prime factors without expanding to unnecessary product sizes.

Problem

Solve x ≡ 2 (mod 12) and x ≡ 14 (mod 18) to show compatibility under non-coprime conditions.

How to use

Enter `2, 14` in the Remainders field and `12, 18` in the Moduli field.

FAQ

Can this tool solve congruences with non-coprime moduli?

Yes, it uses the generalized Chinese Remainder Theorem to find a solution modulo the LCM if the system is consistent.

What happens if a system of congruences has no solution?

If the difference between remainders is not divisible by the greatest common divisor of their moduli, the solver identifies and rejects the system as inconsistent.

Are negative remainders allowed as input?

Yes, negative remainders are automatically reduced modulo their respective modulus m before solving.

What is the maximum number of congruences supported?

The solver supports systems containing between 2 and 20 simultaneous congruence equations.

What is the minimum value required for each modulus?

Each modulus m must be an integer greater than or equal to 2.

Home
Tools3212
Samples593
Visualizations471
Viewers103
Hubs239
Tags333
Images, Audio & Video657

Image, audio, and video processing, conversion, and optimization tools

Math, Date & Finance647

Calculators, numerics, date logic, statistics, and finance tools

Design & Color298

Color, layout, graphics, visual styling, and design helper tools

Text & Writing209

Writing, cleanup, formatting, extraction, and text analysis tools

Developer & Web193

Developer utilities, networking, web debugging, and automation helpers

Conversion & Encoding175

Format, file, archive, unit, and encoding conversion tools

Lead Generation Quiz Launch and Contact Handoff
Memorial Drafts: Family Review and Print Handoff
Private Habit Records: Backup, Restore and Sharing Review
Article to X and LinkedIn Drafts: Fact Review and Handoff
Markdown Interactive Deck Review and Offline Handoff

© 2026 Elysia Tools. All rights reserved.

DocsPricingAboutTerms of ServicePrivacy PolicyCookiesContact
Messaging

NATS Message System Samples

NATS messaging system examples including pub/sub, request-reply, queue groups, and JetStream for modern cloud-native applications

Python

Web Image Processing Python Samples

Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion

Text Processing

Chinese-English Mixed Text Samples

Sample text files with mixed Chinese and English content for testing automatic spacing tools

Text Processing

Text with Chinese Samples

Mixed language text containing Chinese characters for testing Chinese extraction

Math & Numbers

Carmichael Function λ(n) Calculator

Group exponent λ(n) from prime factorization with φ(n) comparison, primitive-root existence, Korselt's Carmichael-number detection, and optional sample-unit verification.

Math & Numbers

Permutation / Combination / Subset Generator (With Repeats)

Deduplicated, lexicographic permutations / combinations / subsets of up to 12 items with exact multiset counts; display capped at 200 entries.

Math & Numbers

Euler Totient Function φ(n) Calculator

Exact φ(n) from trial-division factorization (n ≤ 10¹²) with optional coprime listing and Euler's theorem recall.

Math & Numbers

Fraction Decimal Converter

Convert between fractions and decimals with support for mixed numbers, improper fractions, and various decimal formats

Remainders: 2, 14 | Moduli: 12, 18

Outcome

Yields x = 14 modulo LCM(12, 18) = 36 after verifying gcd(12, 18) = 6 divides (14 - 2).