News for hackers. Stuff that matters.
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.
Re:Is this prime? by sdenton4 on Tuesday March 08, 2016 @11:50AM (#11246462)
The more general test for eleven is to check that the alternating sum of the digits is zero.
Re:Is this prime? by cousin_it on Tuesday March 08, 2016 @01:48PM (#11247477)
Counterexample: 209. The even more general test is that the alternating sum of digits is divisible by 11.
Re:Is this prime? by sdenton4 on Tuesday March 08, 2016 @11:54PM (#11251016)
(I'll pretend to defend myself and say I meant zero mod eleven. :) )