1997 AMC 12 第 30 题

先试着解答 1997 AMC 12 第 30 题,然后核对你的答案与精心整理的解答,解答来自 LIVE by Po-Shen Loh。你也可以参加完整限时模拟考试、查看全部 1997 AMC 12 解答,或核对答案。

所有题目均经美国数学协会(MAA)官方合法授权使用。

30.

对正整数 nn,用 D(n)D(n) 表示 nn 的二进制表示中相邻且不同的数字对的个数。例如,D(3)=D(112)=0D(3)=D(11_2)=0、D(21)=D(101012)=4D(21)=D(10101_2)=4、D(97)=D(11000012)=2D(97)=D(1100001_2)=2。有多少个不超过 9797 的正整数 nn 满足 D(n)=2D(n)=2?
For positive integers n,n, denote by D(n)D(n) the number of pairs of different adjacent digits in the binary (base two) representation of n.n. For example, D(3)=D(112)=0,D(3)=D(11_2)=0, D(21)=D(101012)=4,D(21)=D(10101_2)=4, and D(97)=D(11000012)=2.D(97)=D(1100001_2)=2. For how many positive integers nn less than or equal to 9797 does D(n)=2?D(n)=2?
1616
2020
2626
3030
3535
答案:C
知识点:binary representation组合
小提示:
符合条件的二进制数由一段 11、一段 00、再一段 11 组成
A valid binary numeral consists of a block of 11s, then 00s, then 11s
大提示:
按位数统计三至六位的情况,再单独处理七位数的上界 97=1100001297=1100001_2
Count by bit length through six bits, then handle the seven-bit cutoff 97=1100001297=1100001_2 separately
解答:
一个恰好发生两次数字变化的 dd 位二进制数必为 1a0b1c1^a0^b1^c 的形式,其中 aa、bb、cc 均为正整数,因此共有 (d−12)\binom{d-1}{2} 种。对 d=3d=3、d=4d=4、d=5d=5、d=6d=6,总数为 1+3+6+10=201+3+6+10=20。在不超过 11000012=971100001_2=97 的七位数中,以单个 11 开头的五种形式都符合条件;以至少两个 11 开头的形式中,只有 110000121100001_2 本身符合上界。因此共有 20+6=2620+6=26 个,正确答案是 C。
A dd-bit numeral with exactly two changes has form 1a0b1c1^a0^b1^c with positive a,a, b,b, c,c, giving (d−12)\binom{d-1}{2} choices. For d=3,d=3, d=4,d=4, d=5,d=5, d=6,d=6, the total is 1+3+6+10=20.1+3+6+10=20. Among seven-bit numbers at most 11000012=97,1100001_2=97, the five forms beginning with one 11 all work, and the only form beginning with at least two 11s is 110000121100001_2 itself. Thus there are 20+6=26,20+6=26, and C is correct.
LIVE by Po-Shen Loh
LIVE项目

LIVE直播课程

Self-Paced录播课程

启明星Star计划

奖学金项目

关于我们

罗博深是谁?

邮件联系

订阅英文简报

加入我们

申请明星导师

For a more Thought Full world.

© 2026 Expii, Inc.