返回题库

最小正整数:除以 2..10 余数依次为 1..9

Find the smallest positive integer

专题
Brainteaser / 脑筋急转弯
难度
L4

题目详情

求最小的正整数 nn,使得:

  • nn 除以 2 余 1;
  • nn 除以 3 余 2;
  • nn 除以 4 余 3;

……一直到 nn 除以 10 余 9。

Find the smallest positive integer that leaves a remainder of 1 when divided by 2, a remainder of 2 when divided by 3, a remainder of 3 when divided by 4, .. and a remainder of 9 when divided by 10.

解析

题意为对每个 k=2,3,,10k=2,3,\ldots,10 都有

nk11(modk).n\equiv k-1\equiv -1\pmod k.

因此 n+1n+1 同时被 2 到 10 的所有整数整除,即

n+1 是 lcm(2,3,,10)=2520 的倍数.n+1\text{ 是 }\mathrm{lcm}(2,3,\ldots,10)=2520\text{ 的倍数}.

最小正解取 n+1=2520n+1=2520,得到

n=2519.\boxed{n=2519}.