News for hackers. Stuff that matters.
Re:Sexy prime by amelius on Friday February 15, 2019 @09:45PM (#19176695)
But what if you start with a binary representation?
Re:Sexy prime by firethief on Friday February 15, 2019 @10:07PM (#19176790)
Do it in quaternary. Add pairs of bits.
Re:Sexy prime by avnerium on Saturday February 16, 2019 @05:11AM (#19177997)
Or you can form the alternating sum of the bits, e.g. for 0b10011001 you calculate 1-0+0-1+1-0+0-1 = 0 which is divisible by three. (That's similar to the divisibility test by 11 of a number in base-10, or more generally testing if a number in base `b` is divisible by b+1)