Re:Is this prime?
by madcaptenor on Tuesday March 08, 2016 @11:40AM
(#11246368)
I've heard 91 called the "smallest non-obvious composite". Assume that testing for divisiblity by 2, 3, 5, and 11 is easy - for 2 and 5 you just look at the last digit, for 3 you take the sum of the digits, and with two-digit numbers a number is divisible by 11 if and only if both its digits are the same. Also assume that you can recognize squares. Then 91 = 7*13 is the first number that you won't recognize as composite using these test.
The more general test for eleven is to check that the alternating sum of the digits is zero.
Counterexample: 209. The even more general test is that the alternating sum of digits is divisible by 11.
(I'll pretend to defend myself and say I meant zero mod eleven. :) )
There is a rule for divisibility by 7 - take the last digit, double it, and subtract from the rest of the numbers. If that is divisible by 7, the original number is too. For example, 91 gives 9 - 2 * 1 = 7, so it is divisible by 7
Neat trick! Just used it to find out that this post id is divisible by 7.
Re:Is this prime?
by miracle_code on Tuesday March 08, 2016 @11:23AM
(#11246211)
143 and 169 come to mind as well. Got 65 as highest score btw, was always a good calculator.
Obviously 5 * 13 is too easy. There's a test for division by 3, so 9 * 13 is too easy.
So basically you should only miss 91.