@willkirkby @glitch like, technically, or the maths?
@willkirkby @glitch you're interested in the remainder when dividing k by N. Start with remainder 0. For each digit in k, multiply your current remainder by 10 (i.e. shift all previous digits left 1 space), then add the digit. Work mod N. If you end up back at 0, you've got a multiple of N
@willkirkby @glitch Dotted blue lines from space i point to (10*i) mod N. Solid green lines point to (i+1) mod N
@willkirkby @glitch I've written this, but in more detail, at divisibility-diagrams.glitch.me/what.html