WOLFRAM|DEMONSTRATIONS PROJECT

Chinese Remainder Theorem

​
rem
1
1
mod
1
7
rem
2
2
mod
2
8
rem
3
3
mod
3
9
rem
4
0
mod
4
1
rem
5
0
mod
5
1
rem
6
0
mod
6
1
remainder
1
2
3
0
0
0
498
modulus
7
8
9
1
1
1
504
For a parade, marchers are arranged in columns of seven, but one person is left out. In columns of eight, two people are left out. With columns of nine, three people are left out. How many marchers are there? The given data is
x≡1(mod7)
,
x≡2(mod8)
, and
x≡3(mod9)
. Since the moduli
(7,8,9)
are relatively prime, the Chinese remainder theorem can be used to find the unique possible number of marchers between
1
and
789=504
. There are 498 marchers.