Here's a way I do it in my head:
For every block of six digits "fedcba" calculate (a-d)+3(b-e)+2(c-f). The number is divisible by 7 if the sum is divisible by 7.
Fun thing is you know any number with digits "abcabc" is divisible by 7.
abcabc = 1001 × abc = 7 × 11 × 13 × abc
so abcabc also is divisible by 11 and 13.That also means that, to check divisibility of abcdef by 7, 11, or 13, compute |def-abc| and check whether that is divisible by 7, 11, or 13 since
abcdef = abcabc + (def - abc) = defdef + 1000 × (abc-def)
Similarly, since 10001 = 73 × 137, abcdabcd always is divisible by 73 and 137.Oh and if you are copy pasting into notebook, then x %7 == 0 probably is a reasonable substitute...
Sort of silly, but it passes the time.
But a python notebook could definitely beat me in a race.