Files
python/TangDou/LuoGuBook/P1217.md
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

14 lines
502 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

回文数有两种
一种是单数位数,$abcba$,一种是双数位数,$abccba$
而双数位数是质数的只有$11$,为什么?
中间$0$的个数必然是偶数个$0$
证明: 设$f(n)$ = 1000...0001, $n$为偶数 则有
$f(n) - 11 = 999...9990$, 9的个数为n个 ,对于偶数个9,必然被11整除
偶回文数的各个数位可以分解为 n * 100...001(两个1中间若干个0)的形式 而这个 100..001 是能被11整除的
因为其余的都是11的倍数