微信公众号:科文路。转发须注明出处。
Casting Out Nines,弃九法;用于检查整数乘法、加法的结果是否错误。
表述
“Casting out nines” is an elementary check of a multiplication which makes use of the congruence $10^n \equiv 1$ ($\mod 9$;mod 为取余数符号). Let decimal numbers be written $a=a_n\cdots a_2a_1a_0$, $b=b_n\cdots b_2b_1b_0$, and their product be $c=c_n\cdots c_2c_1c_0$. Let the sums of the digits of these numbers be $a^\ast$, $b^\ast$, and $c^\ast$. Then $a\equiv a^\ast$ ($\mod 9$), $b\equiv b^\ast$ ($\mod 9$), and $c\equiv c^\ast$ ($\mod 9$). Furthermore $ab\equiv a^\ast b^\ast$ ($\mod 9$), so $c\equiv c^\ast$ ($\mod 9$). So if $c$ and $a^\ast b^\ast$ are incongruent ($\mod 9$), the multiplication has been done incorrectly.