市面上的材料各有缺口:World Scientific 一类只给题和答案,不告诉你「为什么想到这一步」;新加坡数学到高中竞赛就断档;机构和教材只卖课不卖讲义。
所以这份材料的定位很清楚:题面用英文(考场语言),思路用中文(讲题感),解答用英文(考场书写)。中文部分不翻译英文解答,而是补英文解答从来不写的那个环节——「第一步为什么会想到用它」。
| English | 中文 | 说明 / Note |
|---|---|---|
| congruence modulo m | 同余(模 m) | a ≡ b (mod m) 意思是 m | (a−b)。同余可以加、减、乘,不能随便除(除之前要保证与 m 互素)。 |
| residue / residue class | 剩余 / 剩余类 | n mod m 的取值叫剩余;按剩余分组叫剩余类。 |
| modular inverse | 模逆 | a 的模逆是满足 ax ≡ 1 (mod m) 的 x,存在当且仅当 gcd(a,m)=1。 |
| order of a mod m | 阶 | 最小的 d>0 使 ad ≡ 1 (mod m),记 ordm(a);必有 ord | φ(m)。 |
| Fermat's little theorem | 费马小定理 | p 素数、p ∤ a 时 ap−1 ≡ 1 (mod p)。 |
| Euler's theorem | 欧拉定理 | gcd(a,m)=1 时 aφ(m) ≡ 1 (mod m)。费马是它的特例。 |
| totient function φ | 欧拉函数 | 1..m 中与 m 互素的个数。 |
| Chinese Remainder Theorem (CRT) | 中国剩余定理 | 模两两互素时,多个同余条件合成唯一一个模乘积的剩余类。 |
| quadratic residue / k-th power residue | 二次剩余 / k 次剩余 | 能不能开平方 / 开 k 次方(模素数意义下)。 |
| base-b representation | b 进制表示 | n = Σ dibi,0 ≤ di < b。 |
| leading digit | 首位数字 | k 位进制表示中不能为 0 的那一位。 |
| digits are pairwise distinct | 数位两两不同 | 注意「两两不同」≠「不都相同」。 |
| divides / divisibility | 整除 | d | n。 |
| prime factorization | 素因数分解 | n = ∏ pe。 |
| p-adic valuation vp(n) | p 进赋值 | n 中 p 的指数。做整除题先把 vp 写出来。 |
| perfect square | 完全平方数 | 所有素因子指数都是偶数。 |
| Hensel's lemma / lifting a solution | 亨泽尔提升 | 模 p 的解提升到模 p2、p3。 |
| root of unity | 单位根 | ωn=1。xn−1 = ∏(x−ωk) 是这类题的钥匙。 |
| greatest integer function / floor ⌊x⌋ | 取整函数 | 不超过 x 的最大整数。 |
| palindrome | 回文数 | 正读反读一样。 |
| multiple / least positive multiple | 倍数 / 最小正倍数 | 「least positive multiple of 23」就是 23 的最小正倍数,别想成别的。 |
定义。m | (a−b) 记作 a ≡ b (mod m)。它把「整除」翻译成「相等」,这是全部数论题的起点——一旦能写成 ≡,就能加、减、乘、乘方。
三条铁律。
为什么这一步要先做。看到「余数」「被 m 整除」「末尾几位」,第一反应就是把整个式子挪到 mod m 下面;很多题一挪过去,未知量就只剩几个可能的剩余类了。
考场速记:求 mod 1000 → 分别算 mod 8 和 mod 125 再合成;求 mod 100 → 算 mod 4 和 mod 25。
阶。ordm(a) 是最小的 d 使 ad ≡ 1 (mod m)。两条最有用的性质:ord | φ(m),且 ak ≡ 1 ⟺ ord | k。
费马 / 欧拉。gcd(a,m)=1 ⟹ aφ(m) ≡ 1 (mod m)。它是降指数的许可证:算 an mod m 时,把 n 对 φ(m) 取模。
什么时候想到「阶」。当条件写成 ak ≡ ±1 (mod m) 的时候。例如 n4 ≡ −1 (mod p) 立刻给出 n8 ≡ 1、n4 ≢ 1,于是 8 = ordp(n),从而 8 | p−1——一个纯整除结论,把 p 的范围一刀砍掉大半。
提升技巧(LTE 的轻量版):ordp(a) 已知时,ordp²(a) 只有两种可能:等于它,或者乘上 p。先算小的,再检验一下就能定。
陈述。m1,…,mr 两两互素,则「n ≡ ai (mod mi)」有解,且解在 mod m1…mr 意义下唯一。
手算怎么合。永远一次合两个:已知 n ≡ a (mod m),n ≡ b (mod k),写 n = a + mt,代进第二个得 mt ≡ b − a (mod k),解出 t 的剩余类(这一步就是一次模逆),再回代。重复即可。
考题里怎么认出 CRT。凡是出现「多个余数条件同时成立」「被 2、3、4、5、6 除的余数」「周期是 lcm」的,都是 CRT 的变体。另外注意一个反复出现的细节:n mod 2、n mod 4、n mod 6 的奇偶性完全相同——这类「余数要两两不同」的题,奇偶性先帮你砍掉一半分支。
展开式是唯一入口。「abc 的九进制是 bca」这类题,就是把同一句话写成两个多项式相等:100a+10b+c = 81b+9c+a。剩下的全是解方程。
数字范围先夹一次。a,b,c 都在 0..8 里 ⇒ 99a = 71b+8c ≤ 71·8+8·8,立刻得到 a ≤ 6。范围一夹,枚举量就从 9³ 掉到 6。
回文 / 特殊形式先参数化。k 位回文不要枚举,直接写成 (d1 d2 d2 d1)8 = 513d1+72d2,再把「< 1000」代进去定 d1。
整除 = 逐素数看指数。「n 是完全平方」⟺ 每个素因子的指数都是偶数。所以处理「13!/m 是完全平方」这类题,正确顺序是:先分解 13!,再对每一个素数单独锁定 m 的指数的奇偶性——千万不要整体乱算。
题目说「把某一位改成 1 后能被 7 整除」,就要把每一个「改成」都写成一个同余式,然后两两相减把变量孤立出来。四个式子相减,a、b、c、d 会一个个掉出来。这是 AIME 数论最常考的发散点:不是算得快,而是敢不敢把一句话翻成一行同余。
要解 xk ≡ c (mod p),先算 ordp(x):写 x = ge,则条件是 ke ≡ logg c。实用结论:p | n4+1 ⟹ p ≡ 1 (mod 8)(p=2 要单独试)。先推出「哪些素数可能」,答案往往就是最小的那一个。
vp 适合处理「p2 整除」这类条件。想求模 p2 的解,先从模 p 的解出发,设 n = r + pt,展开后只保留到一阶项:f(r+pt) ≡ f(r) + pt·f′(r) (mod p2)。若 f′(r) ≢ 0 (mod p),则每个模 p 的解唯一提升一个模 p2 的解。这就是 Hensel 提升。
AIME 特有的一条:答案是 000–999 的整数。算出一个「好像很大」的数时,先确认是不是要求余数,或者是不是要输出末三位补零。本页所有答案都按这个格式给。
「同一个数的两套写法」= 两个展开式相等。十进制 abc = 100a+10b+c;九进制 bca = 81b+9c+a。相等之后只剩一条方程 99a = 71b + 8c,三个未知量一个方程,看上去不够——但这里有两把刀:
于是 6 种 a、每种唯一 b,代入求 c,只看 c 是否落在 0..8。这类题的关键意识是:一个方程配两把刀(范围 + 取模),就能把三个未知量变成一维枚举。
Let N = 100a + 10b + c. Because N is a three-digit number, a ≥ 1; because a, b, c all appear as digits in base nine, each lies in {0,1,…,8}, and b ≥ 1 (it is the leading digit of the base-nine numeral). The base-nine expansion gives N = 81b + 9c + a. Hence
100a + 10b + c = 81b + 9c + a, equivalently 99a = 71b + 8c.
Since 71b + 8c ≤ 71·8 + 8·8 = 632, we get 99a ≤ 632, so a ≤ 6.
Reduce 99a = 71b + 8c modulo 8. Since 99 ≡ 3 and 71 ≡ 7 (mod 8), this gives 3a ≡ 7b (mod 8), i.e. 3a ≡ −b (mod 8), so b ≡ −3a (mod 8). For a = 1,…,6 this forces b ≡ 5, 2, 7, 4, 1, 6 respectively, and every such residue lies in {1,…,8}, so b is determined. Substituting and solving for c = (99a − 71b)/8:
The only solution is (a, b, c) = (2, 2, 7). Check: 227 in base nine is 2·81 + 7·9 + 2 = 162 + 63 + 2 = 227.
两个观察决定全题:
正确顺序是:先分解 13!,然后对 2、3、5、7、11、13 一个一个处理。7、11、13 的指数都是 1,所以 m 必须各含一个——它们的指数被完全钉死。剩下的 2、3、5 各自是一个「从 0 到上限挑同奇偶数」的问题。
最后求和时不要真去加这些巨大的 m:把「所有合法 m 的和」写成三个等比部分和的乘积,再分解看指数。这是本题最省力的一步。
Factor 13! by counting prime powers: v2 = 6+3+1 = 10, v3 = 4+1 = 5, v5 = 2, and v7 = v11 = v13 = 1. So
13! = 210·35·52·7·11·13 = 6 227 020 800.
If 13!/m is a perfect square then 13!/m is an integer, so m | 13!. Write m = 2x3y5z7p11q13r with 0 ≤ x ≤ 10, 0 ≤ y ≤ 5, 0 ≤ z ≤ 2, p, q, r ∈ {0,1}. Then
13!/m = 210−x35−y52−z71−p111−q131−r
is a perfect square exactly when all six exponents are even. This is six independent conditions:
So there are 6·3·2 = 36 valid values of m, and their sum factorizes as a product of geometric-type sums (one factor per prime):
Σ m = (20+22+24+26+28+210)(31+33+35)(50+52)(7)(11)(13)
= (1365)(273)(26)(7)(11)(13).
Factor each piece: 1365 = 3·5·7·13, 273 = 3·7·13, 26 = 2·13. Multiplying and collecting exponents,
Σ m = 21325173111134 = 9 698 458 770.
Therefore a + b + c + d + e + f = 1 + 2 + 1 + 3 + 1 + 4 = 12.
最容易漏的一步是先看奇偶性:n mod 2、n mod 4、n mod 6 三者的奇偶性都等于 n 的奇偶性,所以这三个余数必然同奇偶。它们又要两两不同,那么只能是同一个奇偶类里「从小到大」排下去的三个值——这一步把三个余数几乎全部锁死。
接着 r3 和 r5 就被「不能重复」逼出来(r3 的取值还要和 mod 4、mod 6 的条件自洽——这一步是本题的检查点,不自洽就说明奇/偶分支走错了)。
剩下的就是 CRT:把 5 个余数条件先合成 mod 4 与 mod 6(得 mod 12),再和 mod 5 合成 mod 60。最终答案落在一个周期 60 的剩余类集合上,数个数时分清「17 个」和「16 个」——端点千万别手滑。
Write rk = n mod k. Note that r2, r4, r6 all have the same parity (namely the parity of n). Since they must be pairwise distinct, each is forced once r2 is known.
Case 1: n even. Then r2 = 0. The values r4 ∈ {0,2} and r6 ∈ {0,2,4} must be even and distinct from 0 and from each other, so r4 = 2 and r6 = 4. Now r3 ∈ {0,1,2} must avoid {0, 2, 4}, so r3 = 1; and r5 ∈ {0,…,4} must avoid {0, 2, 4, 1}, so r5 = 3. So
n ≡ 0 (2), n ≡ 1 (3), n ≡ 2 (4), n ≡ 3 (5), n ≡ 4 (6).
The conditions mod 4 and mod 6 give n ≡ 10 (mod 12); combining with n ≡ 3 (mod 5) (moduli coprime) gives n ≡ 58 (mod 60).
Case 2: n odd. Then r2 = 1, so r4 = 3 and r6 = 5. Conditions mod 4 and mod 6 give n ≡ 11 (mod 12), which forces r3 = 11 mod 3 = 2 — and indeed 2 ∉ {1,3,5}, consistent. Then r5 must avoid {1, 3, 5, 2}, so r5 ∈ {0, 4}. Putting n = 11 + 12t, we have n ≡ (1 + 2t) (mod 5); this equals 0 for t ≡ 2 (mod 5) and equals 4 for t ≡ 4 (mod 5). Hence
n ≡ 11 + 24 = 35 (mod 60) or n ≡ 11 + 48 = 59 (mod 60).
So the extra-distinct integers are exactly those with n ≡ 35, 58, or 59 (mod 60). Counting those below 1000:
Total 17 + 16 + 16 = 49.
「小于 1000」在八进制里是「最多 4 位」(因为 84 = 4096 > 1000);而题目要的是最大的那个,所以只需看八进制的四位回文,三位以下一定更小。
把四位八进制回文写成 (d1d2d2d1)8,展开成 513d1 + 72d2。再把「< 1000」代进去:d1 只能取 1(取 2 就 1026 > 1000 了),于是 d2 ≤ 6。
候选只剩 7 个数,逐个看十进制是不是回文即可。这类题的效率全在「先参数化再夹范围」,一眼枚举 1..999 是浪费考场时间。
Since 84 = 4096 > 1000, every n < 1000 has at most four base-eight digits. Any number with at most three base-eight digits is less than 83 = 512, so we first search among the four-digit base-eight palindromes
(d1 d2 d2 d1)8 = 512d1 + 64d2 + 8d2 + d1 = 513d1 + 72d2,
with d1 ∈ {1,…,7} and d2 ∈ {0,…,7}. Requiring the value to be < 1000 rules out d1 ≥ 2 (since 513·2 = 1026), so d1 = 1 and 513 + 72d2 < 1000 gives d2 ≤ 6. The candidates are
513, 585, 657, 729, 801, 873, 945.
Checking which are base-ten palindromes: 513, 657, 729, 801, 873, 945 are not (their first and last digits differ), while 585 reads the same both ways. Its base-eight form is 1111eight: indeed 1·512 + 1·64 + 1·8 + 1 = 585. Since 585 already exceeds 511, no number with fewer base-eight digits can beat it.
给定了三个商,n 就被三个区间同时夹住:4a ≤ n ≤ 4a+3、5b ≤ n ≤ 5b+4、6c ≤ n ≤ 6c+5(a、b、c 是那三个商)。三个区间的交集仍然是一个区间,所以「n 能被唯一确定」⟺ 「这个交集恰好只有一个整数」⟺ 左端点 L 和右端点 U 都等于 n。
而 U = n 等价于「n+1 的三个商与 n 不同」,这是一条纯粹的取模条件:⌊(n+1)/k⌋ ≠ ⌊n/k⌋ ⟺ n ≢ k−1 (mod k)。于是
U = n ⟺ n ≡ 3 (4) 或 n ≡ 4 (5) 或 n ≡ 5 (6) ——记作 A(n)。
同理 L = n ⟺ A(n−1)。所以 n 被唯一确定 ⟺ A(n−1) 与 A(n) 同时成立。
A 以 lcm(4,5,6) = 60 为周期。n 从 1 到 600 正好是 10 个完整周期,数一数一个周期里有多少对相邻的 A,乘以 10 就行。
一个真实踩过的坑(值得单独记住):如果只把 n 限制在 1..600 范围内判断唯一性,答案是 81;但「给定三个商」时,得到这些商的那个 n 完全可能是 601。n = 600 的三个商是 150、120、100,而 n = 601,602,603 给出同样的三个商,所以 600 不能被唯一确定。差的正是这一个数,答案 80 而不是 81。
Fix n and set a = ⌊n/4⌋, b = ⌊n/5⌋, c = ⌊n/6⌋. Any m with the same triple satisfies 4a ≤ m ≤ 4a+3, 5b ≤ m ≤ 5b+4 and 6c ≤ m ≤ 6c+5, so the set of such m is the interval of integers [L, U] with
L = max(4a, 5b, 6c), U = min(4a+3, 5b+4, 6c+5).
The triple determines n uniquely exactly when L = U = n.
Now ⌊(n+1)/k⌋ = ⌊n/k⌋ fails to hold precisely when k | (n+1), i.e. when n ≡ k−1 (mod k). Hence U = n ⟺ the triple of n+1 differs from that of n ⟺ n ≡ 3 (mod 4), or n ≡ 4 (mod 5), or n ≡ 5 (mod 6). Call this property A(n). Symmetrically, L = n ⟺ A(n−1) (this also handles n = 1 correctly, since A(0) is false: 0 ≢ 3, 0 ≢ 4, 0 ≢ 5). Therefore
n is uniquely determined ⟺ A(n−1) and A(n).
A has period lcm(4,5,6) = 60. The residues A(r) with 0 ≤ r < 60 are the 28 values 3, 4, 5, 7, 9, 11, 14, 15, 17, 19, 23, 24, 27, 29, 31, 34, 35, 39, 41, 43, 44, 47, 49, 51, 53, 54, 55, 59. Among them, two consecutive residues r and r+1 are both in A exactly for r ≡ 3, 4, 14, 23, 34, 43, 53, 54 (mod 60) — 8 residues per period.
Finally, n ranges over 1 ≤ n ≤ 600, so r = n − 1 ranges over 600 consecutive integers, i.e. exactly 10 full periods of length 60. The count is 8 · 10 = 80.
(Check on the subtlety at the top end: for n = 600 we have (a,b,c) = (150,120,100), and m = 601, 602, 603 share that same triple, so 600 is not uniquely determined — matching A(600) being false.)
an 有两个条件:是 23 的倍数、≡ 1 (mod 2n)。因为 an 是最小正倍数,它一定小于 23·2n(模 2n 的最小正解乘 23)。于是可以把它写成
an = 1 + tn·2n, 1 ≤ tn ≤ 22.
下界 1 是哪来的(补):tn = 0 会让 an = 1,而 1 不是 23 的倍数,与「an 是 23 的倍数」矛盾,所以 tn ≥ 1;上界 22 则来自前面的 an < 23·2n。正因为 1..22 这段区间是闭的、且每个模 23 的剩余类在这里恰好有一个代表,后面「tn 被模 23 完全钉死」才成立。
这一步是本题的转轴:tn 被「模 23」完全钉死——两边 mod 23 得 tn ≡ −2−n (mod 23),而 1..22 里这样的数只有一个。
接下来处理 an = an+1。这里要先把「最小」两个字用足:an 是满足「是 23 的倍数、且 ≡ 1 (mod 2n)」的数里最小的那个,而 an+1 ≡ 1 (mod 2n+1) 自动给出 an+1 ≡ 1 (mod 2n),所以 an+1 也是 an 的一个候选,必有
an ≤ an+1.
有了这个方向,两个数又都 ≡ 1 (mod 2n),等价关系才立得住:
an = an+1 ⟺ an+1 ≤ an ⟺ an 自己就已 ≡ 1 (mod 2n+1) ⟺ 2n+1 | an − 1 = tn2n ⟺ tn 是偶数.
「最小」这一步在补什么(补):它只提供一个方向——由 an 的最小性得到 an ≤ an+1;而链子中间那一环「an+1 ≤ an」是从「an 本身就是 2n+1 级的解」来的。两个不等式合起来才等于「an = an+1」;少任何一个方向,都只能得到一个不等式,推不出相等。
最后用 211 = 2048 = 89·23 + 1 ≡ 1 (mod 23):于是 2−n mod 23 只依赖 n mod 11,只剩 11 种情况要查表——把 2e mod 23 (e = 0..10) 列出来,看哪些是奇数即可。
这题体现的是数论里最常用的一个动作:把「整除 2 的幂」的困难信息,转换成「模一个奇素数」的容易信息。两者一交叉,问题就塌缩成有限的查表。
Since gcd(23, 2n) = 1, the congruence 23u ≡ 1 (mod 2n) has a unique solution un modulo 2n, and the least positive multiple of 23 congruent to 1 modulo 2n is an = 23un with 1 ≤ un < 2n. Hence 1 ≤ an < 23·2n, so writing
an = 1 + tn2n
gives 1 ≤ tn ≤ 22. Reducing an ≡ 0 (mod 23) yields 1 + tn2n ≡ 0 (mod 23), that is
tn ≡ −2−n (mod 23),
and tn is the unique integer in [1,22] in that class.
Now an = an+1 ⟺ 2n+1 divides an − 1 = tn2n ⟺ tn is even. Indeed, if tn is even then an ≡ 1 (mod 2n+1) and an is a multiple of 23, so an+1 ≤ an; conversely an+1 ≡ 1 (mod 2n+1) implies an+1 ≡ 1 (mod 2n), so an+1 is an admissible candidate for an and an ≤ an+1.
Since 211 = 2048 = 89·23 + 1 ≡ 1 (mod 23), the value of 2−n modulo 23 depends only on m = n mod 11. Listing 2e mod 23 for e = 0,…,10:
1, 2, 4, 8, 16, 9, 18, 13, 3, 6, 12.
With e = (11 − m) mod 11 we get tn = 23 − (2e mod 23), and tn is even ⟺ 2e mod 23 is odd. From the list, the odd entries occur at e = 0 (value 1), e = 5 (value 9), e = 7 (value 13) and e = 8 (value 3), corresponding to m = 0, 6, 4, 3 respectively. Hence
an = an+1 ⟺ n ≡ 0, 3, 4, or 6 (mod 11).
Finally 1000 = 11·90 + 10, so among 1 ≤ n ≤ 1000 there are 90 complete blocks of 11 residues (contributing 4 each) plus the tail residues 1,…,10, of which 3, 4, 6 qualify. The count is 90·4 + 3 = 363.
题分两段:①定 p,②在 p2 下解方程。第一段不要试除,用阶一步到位:p | n4+1 给出 n4 ≡ −1,于是 n8 ≡ 1 而 n4 ≢ 1,所以 ordp(n) = 8,由 ord | p−1 得 8 | p−1,即 p ≡ 1 (mod 8)。(p = 2 单独试:奇数的 4 次方 ≡ 1 (mod 16),所以 n4+1 ≡ 2 (mod 16),4 永远不整除它。)
最小的是 p = 17,而且真的行(24+1 = 17),所以 p = 17。
第二段:先解 mod 17 的四个解(就是 (Z/17)× 中阶为 8 的四个元素),再各自提升一次到 mod 289。因为 f′(n) = 4n3 在 n ≢ 0 (mod 17) 时不为 0,每个 mod 17 的解恰好唯一提升一个 mod 289 的解。
提升的动作只有一行:写 n = r + 17t,则 f(n) ≡ f(r) + 17t·f′(r) (mod 289),解出 t 即可。注意这里要取四个提升解里最小的那个(不是 r 最小的那个!)——110 对应的是 r = 8,不是 r = 2。
Step 1: find p. Suppose an odd prime p divides n4 + 1. Then n4 ≡ −1 (mod p), so n8 ≡ 1 but n4 ≢ 1 (mod p); hence ordp(n) = 8, and since the order divides p − 1 we get 8 | p − 1, i.e. p ≡ 1 (mod 8). For p = 2: n4 + 1 ≡ 0 (mod 2) forces n odd, and every odd n has n4 ≡ 1 (mod 16), so n4 + 1 ≡ 2 (mod 16) is never divisible by 4. So p ≡ 1 (mod 8), and the smallest such prime is 17, which works because 24 + 1 = 17.
Step 2: solve n4 + 1 ≡ 0 (mod 289). Modulo 17, the solutions are the elements of order 8 in (Z/17)×, namely 2, 23 = 8, 25 = 32 ≡ 15, 27 = 128 ≡ 9. So n ≡ 2, 8, 9, 15 (mod 17). Since f(n) = n4 + 1 has f′(n) = 4n3 ≢ 0 (mod 17) for these n, each solution lifts to a unique solution modulo 289. Write n = r + 17t; then f(n) ≡ f(r) + 17t·f′(r) (mod 289), so t is determined by f(r)/17 + t·f′(r) ≡ 0 (mod 17).
Using 8−1 ≡ 15 and 9−1 ≡ 2 and 15−1 ≡ 8 (mod 17):
The solutions modulo 289 are 110, 134, 155, 179, and the least positive one is 110. (Check: 1104 + 1 = 146 410 001 = 289 · 506 609.)
把条件全部写成等式:n = s2(s = √n),n = b·d1 + d0(两位),d1 + d0 = s。三个式子其实只有两个独立信息,先消元:
s2 = b(s − d0) + d0 ⟹ d0(b−1) = s(b − s).
关键一步:把 b − s 换成 (b−1) − (s−1),模 b−1 立刻得到「(b−1) | s(s−1)」——整除条件只和 s 有关,与 d 无关。再令 h = s(s−1)/(b−1),就得到非常漂亮的对称式:d1 = h,d0 = s − h。
于是「数 b-eautiful 的个数」变成「数满足 k | s(s−1)、s(s−1) ≤ k2、√(k+1) ≤ s ≤ k 的 s 的个数」(k = b−1)。因为 gcd(s, s−1) = 1,整除条件把 k 唯一拆成 k = k1k2,k1 | s、k2 | s−1——枚举 k 的约数对即可,不用枚举 s。
为什么能这样拆(补一句理由):因为 s 与 s−1 是相邻整数,必有 gcd(s, s−1) = 1。设 pa 是整除 k 的某个素数幂,由 k | s(s−1) 知 pa | s(s−1),所以 p 至少整除 s 或 s−1 中的一个;而 p 不可能同时整除两者,否则 p 会整除它们的差 s − (s−1) = 1。于是每个 pa 只能整块落进 s、或整块落进 s−1,不能把 p 的指数一笔劈成两半。把每个 pa 按它落的那一边归类,就得到唯一的 k = k1k2,其中 k1 | s、k2 | s−1,且 gcd(k1, k2) = 1。
什么情况下不能这样拆(边界 · 反例):整套推理只用到一件事——两个因子互素。不互素就当场失效。取 a = b = 2、m = 4:4 | 2·2 显然成立,可是要把 m = 4 写成 k1k2 且 k1 | 2、k2 | 2,唯一的非平凡写法 (2, 2) 恰恰是「把 4 里的 2 劈成两半」,而它不满足 gcd(k1, k2) = 1;剩下允许的互素写法只有 (1, 4) 和 (4, 1),两者都要求 4 | 2,也不成立。所以「4 | 2·2」为真,却根本写不出符合条件的 k1、k2。本题之所以能拆,全靠 gcd(s, s−1) = 1 把这类情形挡在了门外。
210 = 2·3·5·7 是 4 个素数的乘积,16 个约数对,所以 b = 211 一下子跳到 15 个。而 b < 211 的个数都不超过 10(205 有 7 个,206..210 都只有 3 个)。
If n has exactly two base-b digits and they sum to √n, write n = b d1 + d0 with 1 ≤ d1 ≤ b−1, 0 ≤ d0 ≤ b−1, and put s = √n, so that d1 + d0 = s and n = s2. Then d1 = s − d0 and
s2 = b(s − d0) + d0 = bs − d0(b−1) ⟹ d0(b−1) = s(b − s).
Since b ≡ 1 (mod b−1), we have b − s ≡ 1 − s (mod b−1), so d0 = s(b−s)/(b−1) is an integer iff (b−1) | s(s−1). Put k = b − 1 and
h = s(s−1)/k, d1 = s − d0 = s − [s(b−s)/k] = s − [s(k+1−s)/k] = s − [s − s(s−1)/k] = h, d0 = s − h.
So the conditions become: k | s(s−1); s(s−1) ≤ k2 (from d1 ≤ b−1 = k); 1 ≤ h = s(s−1)/k ≤ k; 0 ≤ s − h ≤ k; and s2 = n ≥ b = k+1 (so s ≥ √(k+1)); and s ≤ k (since s2 = n < b2, as n has only two base-b digits). Every s with these properties gives exactly one b-eautiful n = s2, and conversely.
Because gcd(s, s−1) = 1, the condition k | s(s−1) means k = k1k2 with k1 | s, k2 | s−1, gcd(k1,k2) = 1 — a unique factorization for each s. So each divisor pair of k produces at most one candidate s, found by solving s ≡ 0 (mod k1), s ≡ 1 (mod k2).
Take k = 210 = 2·3·5·7. Since k is squarefree, every divisor k1 gives a coprime pair (k1, k2 = 210/k1), and the corresponding s is the unique residue mod 210 in [1, 210]; the bound s(s−1) ≤ k2 = 44100 is automatic for s ≤ 210, and we need s ≥ √211 ≈ 14.53. Enumerating the 16 divisors k1:
| k1 | k2 | s | k1 | k2 | s |
|---|---|---|---|---|---|
| 1 | 210 | 1 — too small | 21 | 10 | 21 ✓ |
| 2 | 105 | 106 ✓ | 30 | 7 | 120 ✓ |
| 3 | 70 | 141 ✓ | 35 | 6 | 175 ✓ |
| 5 | 42 | 85 ✓ | 42 | 5 | 126 ✓ |
| 6 | 35 | 36 ✓ | 70 | 3 | 70 ✓ |
| 7 | 30 | 91 ✓ | 105 | 2 | 105 ✓ |
| 10 | 21 | 190 ✓ | 210 | 1 | 210 ✓ |
| 14 | 15 | 196 ✓ | 15 | 14 | 15 ✓ |
That is 15 admissible values of s, hence 15 b-eautiful integers for b = 211 — more than ten. Applying the same criterion to every 2 ≤ b ≤ 210 gives at most 10 (the counts near the top are 7 for b = 205 and 3 for b = 206,…,210; the largest count below 211 is 7). Hence the least such b is 211.
看到「对全体 n 次单位根求积」,第一反应永远是那条恒等式:
xn − 1 = ∏k=0n−1 (x − ωk)。
所以要把被乘的东西凑成 (x − 某个常数) 的形式。这里 x2 − 2x + 2 恰好可以分解成 (x − α)(x − β),其中 α, β = 1 ± i 是它的两根。
于是整个乘积拆成两份,每份都是「∏(ωk − α)」的形状,直接把 α 代进 x13 − 1 就行。唯一要小心的是符号:把 (ωk − α) 改写成 −(α − ωk) 会引入 (−1)13 = −1。
最后 α, β = 1 ± i 的 13 次方不用复数三角式硬算:α4 = −4、α8 = 16,两步就到 α13 = −64(1+i),取共轭得 β13。
Let f(x) = x2 − 2x + 2 = (x − α)(x − β), where α = 1 + i and β = 1 − i are its two roots; note αβ = 2.
The 13th roots of unity are the roots of x13 − 1, so for every y we have ∏k=012 (y − ωk) = y13 − 1. Applying this with y = α and y = β and reversing the sign inside each of the 13 factors,
∏k=012 (ωk − α) = −(α13 − 1) = 1 − α13, ∏k=012 (ωk − β) = 1 − β13.
Therefore the required product equals
∏k=012 f(ωk) = (1 − α13)(1 − β13) = 1 − (α13 + β13) + (αβ)13.
Now (αβ)13 = 213 = 8192. For the other term, α2 = 2i, α4 = (2i)2 = −4 and α8 = 16, so
α13 = α8·α4·α = 16 · (−4) · (1 + i) = −64 − 64i,
and since β is the complex conjugate of α, β13 = −64 + 64i. Hence α13 + β13 = −128 and
∏k=012 f(ωk) = 1 + 128 + 8192 = 8321.
The remainder of 8321 upon division by 1000 is 321.
这题没有任何「算」的难点,难在敢不敢把一句话直接翻成一行。设 N = 1000a+100b+10c+d,「把第 i 位改成 1」就有四个式子。先记住 mod 7 下的三条常数:
1000 ≡ 6 ≡ −1, 100 ≡ 2, 10 ≡ 3 (mod 7)。
于是四个式子长得几乎一样,只是把 a、b、c、d 分别换成常数 1。接下来是纯代数:两两相减,把变量孤立出来。用 (i) 分别减去 (ii)(iii)(iv),直接读出
2b ≡ 3 − a, 3c ≡ 4 − a, d ≡ 2 − a (mod 7)。
然后把其中一组代回 (ii) 自洽,就得到 a 的条件 3a ≡ 1 (mod 7),即 a ≡ 5——这一步是必须做的检查,否则可能解出一组彼此矛盾的式子和一个根本不存在的 N。
剩下的就是「把剩余类翻译回数字」:a ≡ 5、d ≡ 4、b ≡ 6、c ≡ 2 或 9 (mod 7),取 0..9 范围内可能的值,最后挑最大。
Write N = 1000a + 100b + 10c + d with a ∈ {1,…,9} and b, c, d ∈ {0,…,9}. Modulo 7 we have 1000 ≡ 6 ≡ −1, 100 ≡ 2 and 10 ≡ 3. Changing the first, second, third and fourth digit to 1 therefore gives the four conditions
(i) −1 + 2b + 3c + d ≡ 0,
(ii) −a + 2 + 3c + d ≡ 0,
(iii) −a + 2b + 3 + d ≡ 0,
(iv) −a + 2b + 3c + 1 ≡ 0 (all mod 7).
Subtracting (ii), (iii), (iv) from (i) in turn isolates the variables:
(i) − (ii): 2b ≡ 3 − a, (i) − (iii): 3c ≡ 4 − a, (i) − (iv): d ≡ 2 − a.
These are consistent only if (ii) also holds: substituting 3c ≡ 4 − a and d ≡ 2 − a into (ii) gives (4 − a) + (2 − a) ≡ a − 2 (mod 7), i.e. 8 ≡ 3a (mod 7). Since 3−1 ≡ 5 (mod 7), a ≡ 40 ≡ 5 (mod 7), so a = 5.
Then d ≡ 2 − 5 ≡ 4 (mod 7), so d = 4 (the only value in 0,…,9); 2b ≡ 3 − 5 = −2 ≡ 5 (mod 7) with 2−1 ≡ 4 gives b ≡ 20 ≡ 6 (mod 7), so b = 6; and 3c ≡ 4 − 5 = −1 ≡ 6 (mod 7) gives c ≡ 30 ≡ 2 (mod 7), so c ∈ {2, 9}.
Hence N ∈ {5624, 5694}, and the greatest is N = 5694. Check the four numbers obtained by changing a digit to 1: 1694 = 7·242, 5194 = 7·742, 5614 = 7·802, 5691 = 7·813 — all are divisible by 7.
Finally 5694 = 1000·5 + 694, so Q = 5 and R = 694, giving Q + R = 699.
孩子的真实困难往往被误判。多数在美国读书的华裔学生,数论题做不出来不是因为不会算,而是卡在两个地方:
所以这份材料把这两件事分开处理:中文负责「为什么想到这一步」(思路层),英文负责「考场上怎么写」(表达层),题面保持英文原题。孩子练的是同一道题的两半,不用在两本教材之间来回切换。
数论的「难」有一种特殊性质:知识点极少,但组合方式极多。同余、阶、CRT、进制,四个词就够了;难的是看到题目时选哪一个。本讲义刻意把「选择动作」显性化——每一道题的解析里,第一步之后都会写明「这里为什么会想到取模 / 想到阶 / 想到参数化」。这恰好是刷题书不给的部分。
另外,本讲义里 10 道真题全部来自 2022–2024 年的 AIME,难度是近三年的真实水平,不是老题拼盘。
打印建议:本页已做打印样式,直接 Ctrl/Cmd + P 即可,题目卡片不会跨页断开。建议双面打印,思路部分可以先折起来。
这份讲义不是题海。10 道真题 + 9 道练习,够一个专题的训练量,但不足以覆盖 AIME 数论的全部。它的目标是:让孩子把「中国式方法」的四个动作(翻译成同余、夹范围、取模钉死、合成剩余类)变成条件反射。练完这一个专题,再上别的专题会明显快。
下一份准备做的是组合专题(计数与递推),之后是几何专题。如果你想优先看到别的方向(代数 / 数论进阶 / 概率 / AMC 12 衔接),告诉我们你的孩子现在大概在什么水平、卡在哪一类题。
留个联系方式,我们把新专题做好后发给你(本页不留支付,不收费):
aime@infogap.store