Although the method for solving the Chinese remainder problem given in the Classique mathématique de Maître Sun (Sunzi Suanjing), compiled between the 3rd and 5th centuries, suggests that its author apparently understood the general principle involved, he did not state it explicitly. Its first appearance is in a problem involving specific numbers:
"Suppose we have some objects, but do not know how many. If they are counted off in threes, two remain; if they are counted off in fives, three remain; if they are counted off in sevens, two remain. The question is: how many are there?"
Using his method of the Great Expansion (dayan shu), Sun Zi shows that 23 is the smallest solution. Nevertheless, he offers no general method.
The generalization
------------------
Compared with the Classique mathématique de Maître Sun, Qin Jiushao presents more complex problems and a more general solution in his Neuf chapitres du traité des nombres (Shushu Jiuzhang, 1247).