News for hackers. Stuff that matters.
Re:Divisible by 7 (2016) by Traster on Thursday May 20, 2021 @03:47PM (#27226173)
I'm kind of more intersted in why you know this. There's lots of weird esoteric stuff that I know that I need as part of my job, but what are you doing that requires you to know this that isn't "copy paste this number into a python notebook"?

Oh and if you are copy pasting into notebook, then x %7 == 0 probably is a reasonable substitute...

Re:Divisible by 7 (2016) by lurquer on Thursday May 20, 2021 @04:30PM (#27226790)
I can’t speak for the poster, but I learned that trick (and many others) to play a game while stuck in traffic. Namely, derive the prime factorization of the license plate number in front of you before you lose sight of it. (Usually a 5 digit number in my area.)

Sort of silly, but it passes the time.

Re:Divisible by 7 (2016) by tashi on Thursday May 20, 2021 @07:44PM (#27228869)
I test numbers for divisibility by 7 in my head almost every time I do a daily KenKen puzzle. There's usually a four or five-digit number in there whose factors I don't know off the top of my head, so I'll give it a quick check for sevens just to get my bearings.

But a python notebook could definitely beat me in a race.

Re:Divisible by 7 (2016) by meiji163 on Thursday May 20, 2021 @07:26PM (#27228728)
It's just the fact that 1, 10, 100, 1000, ... = 1, 3, 2, -1, -3, -2, ... (repeating) mod 7
Re:Divisible by 7 (2016) by jldugger on Thursday May 20, 2021 @05:02PM (#27227208)
I mean, who isn't loading their Anki decks with random mental math party tricks?