以下是引用算盘在2004-8-18 19:51:17的发言:
判断被7整除的方法有好多种,最简单的方法是:把原数的最后一项抽掉,剩下來的数減去最后那数的两倍,如果余数是7的倍数,该数一定能被7整除。而徒弟出的题目用上述方法显然不适用,所以介绍一个1001法:三位数一組,三位数組……偶数組的数字和 - 奇数組的数字和,看看是不是7的倍数。
对于109870987875875765470537529876
因为109-870+987-875+875-765+476-523+812-703+987-236+756-243+652-437+529-876=665,665/7=95
所以109870987875875765470537529876可以被7整除。
累死鸟,徒弟以后别问这种题目了。[em06][em06]
没问题了,楼下的随便问吧!
is this method faster than brutal force? i seriously doubt so. btw, a slightly faster method would be:
1st digit + 3 times the 2nd digit + 2 times the 3rd digit - the 4th digit - 3 times the 5th digit - 2 times the 6th digit. And then we repeat the sequence, + the 7th digit + 3 times the 8th digit, etc. If the whole "sum" is divisible by 7, then the original number is divisible by 7.
4712954379
9+3(7)+2(3)-4-3(5)-2(9)+2+3(1)+2(7)-4=14
and since 14 is divisible by 7, the original number is divisible by 7. But again this might not be faster than the brutal force way.
i come back home once a year normally. my question is What is the most efficient way to forget a past relationship? |