版本比较
整数的离散性
正文
增加 173 行删除 2 行
37 行未改动38394041424344454637 行未改动### 例题二::::info[题目]{open}求使不等式 $\frac{9}{17}<\frac{n}{n+k}<\frac{8}{15}$ 对唯一整数 $k$ 成立的最大整数 $n$。::::## 后记**原创不易,点个赞再走吧~~****求管理员通过qwq**[更多精彩,关注我们的合集](https://www.luogu.me/article/4y3zfcw5)37 行未改动383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621737 行未改动### 例题二::::info[题目]{open}求使不等式 $\frac{9}{17}<\frac{n}{n+k}<\frac{8}{15}$ 对唯一整数 $k$ 成立的最大整数 $n$。::::# 多元对称有序枚举在多元对称有序枚举时,可以将未知数排序,从小到大(从大到小)进行枚举,每次枚举时,可以稍微卡一下最大数(最小数)的范围,来保证有限枚举。### 例题一::::info[题目]{open}求方程 $\frac{1}{a} + \frac{1}{b} + \frac{1}{c} = \frac{1}{2}$ 的正整数解数量。::::由于原式是对称式,那么不妨设 $a \le b \le c$,易知 $\frac{1}{a} < \frac{1}{2} \le \frac{3}{a}$,得 $3 \le a \le 6$,枚举 $a$ 得到 $\frac{1}{b} + \frac{1}{c} = \frac{x}{y}$,两边同乘 $ybc$ 后因式分解求解即可。::::success[完整解答]{open}不妨设$$a \le b \le c$$易知$$\frac{1}{a} < \frac{1}{2} \le \frac{3}{a}$$$$\therefore 3 \le a \le 6$$---若 $a = 3$$$\therefore \frac{1}{b} + \frac{1}{c} = \frac{1}{6}$$$$\therefore bc - 6b - 6c = 0$$$$\therefore (b - 6)(c - 6) = 36$$$$\therefore \begin{cases}a = 3, 3, 3, 3, 3 \\b = 7, 8, 9, 10, 12 \\c = 42, 24, 18, 15, 12\end{cases}$$---若 $a = 4$$$\therefore \frac{1}{b} + \frac{1}{c} = \frac{1}{4}$$$$\therefore bc - 4b - 4c = 0$$$$\therefore (b - 4)(c - 4) = 16$$$$\therefore \begin{cases} a = 4, 4, 4 \\b = 5, 6, 8 \\c = 20, 12, 8\end{cases}$$---若 $a = 5$$$\therefore \frac{1}{b} + \frac{1}{c} = \frac{3}{10}$$$$\therefore 9bc - 30b - 30c = 0$$$$\therefore (3b - 10)(3c - 10) = 100$$$$\therefore \begin{cases}a = 5 \\b = 5 \\c = 10\end{cases}$$---若 $a = 6$$$\therefore \frac{1}{b} + \frac{1}{c} = \frac{1}{3}$$$$bc - 3b - 3c = 0$$$$\therefore (b - 3)(c - 3) = 9$$$$\therefore \begin{cases}a = 6 \\b = 6 \\c = 6\end{cases}$$---综上,共 $6 \times 6 + 3 \times 3 + 1 = 46$ 组。::::### 例题二当上题中的三个数变为四个数时,枚举量会增加不少;如果 $\frac{1}{2}$ 变成让你求的几个数,你还会这么有耐心的枚举吗?::::info[题目]{open}($2007$,白俄罗斯数学奥林匹克)求所有的正整数 $n$,使它能整除它的不同的四个因数之和。::::建议先阅读下个版块的定义与性质。如果这四个因数为 $a_1, a_2, a_3, a_4$,那么不方便体现四个因数与 $n$ 的关系,在枚举因数时消不掉 $n$,所以设四个因数为 $\frac{n}{a_1}, \frac{n}{a_2}, \frac{n}{a_3}, \frac{n}{a_4}$ 在枚举时就消掉了 $n$,所以问题就变成了 $\frac{1}{a_1} + \frac{1}{a_2} + \frac{1}{a_3} + \frac{1}{a_4} = k \in \Z^{+}$。简单放缩得 $k = 1, 2$,然后逐一枚举即可。::::success[完整解答]{open}设 $n$ 的四个因数为 $\frac{n}{a_1}, \frac{n}{a_2}, \frac{n}{a_3}, \frac{n}{a_4}$,其中 $a_1, a_2, a_3, a_4 \in \Z^{+}, a_1 < a_2 < a_3 < a_4$,且 $a_1, a_2, a_3, a_4 \mid n$。$$\therefore [a_1, a_2, a_3, a_4] \mid n$$由题意$$n \mid \frac{n}{a_1} + \frac{n}{a_2} + \frac{n}{a_3} + \frac{n}{a_4}$$$$\therefore \frac{1}{a_1} + \frac{1}{a_2} + \frac{1}{a_3} + \frac{1}{a_4} \in \Z^{+}$$设$$\frac{1}{a_1} + \frac{1}{a_2} + \frac{1}{a_3} + \frac{1}{a_4} = k \in \Z^{+}$$$$\frac{1}{a_1} + \frac{1}{a_2} + \frac{1}{a_3} + \frac{1}{a_4} = k \le 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} < 3$$$$\therefore k = 1, 2$$---若 $k = 1$$$\therefore \frac{1}{a_1} + \frac{1}{a_2} + \frac{1}{a_3} + \frac{1}{a_4} = 1$$$$\therefore \frac{1}{a_1} < 1 < \frac{4}{a_1}$$$$\therefore a_1 = 2, 3$$---若 $a_1 = 2$由例题一的解,$6 \mid n$ 或 $20 \mid n$。---若 $a_1 = 3$$$\frac{1}{a_2} + \frac{1}{a_3} + \frac{1}{a_4} = \frac{2}{3}$$(省略枚举过程,毕竟简单,跟上一题一样。)解得 $6 \mid n$ 或 $20 \mid n$。---若 $k = 2$若 $a_3 \le 4$,则 $\text{LHS} \le 1 + \frac{1}{2} + \frac{1}{4} + \frac{1}{5} < 1 = \text{RHS}$,矛盾。$$\therefore a_1 = 1, a_2 = 2, a_3 = 3, a_4 = 6$$$$\therefore 6 \mid n$$---综上,$6 \mid n$ 或 $20 \mid n$。::::## 后记**原创不易,点个赞再走吧~~****求管理员通过qwq**[更多精彩,关注我们的合集](https://www.luogu.me/article/4y3zfcw5)