I call this pattern a ourogram, from Greek ουρον, ouron, “tail” + γραμμα, gramma, “symbol”. Here’s the ourogram when each of eight dogs at the vertices of an octagon chases the tail of the dog three places ahead of it, i.e. chase(8, n + 3):
(n + 3 mod v is returned, i.e. the remainder when n + 3 is divided by the number of dogs, but with 8 mod 8 = 0 = 8)
Here’s the ourogram for chase(8, 2n) — dog one (in the one o’clock position) chases dog two, two chases four, three chases six, four chases eight, five chases two, eight chases itself, and so on.
Here are some more chases, some using the div function (div is division without the remainder, i.e. 8 div 3 = 2).
chase(9, 3n)
chase(11, 7n)
chase(18, 16n)
chase(19, 10n)
chase(10, 3n div 2)
chase(12, 3n)
chase(18, 7n)
chase(7, 5n div 8)
chase(14, 11n)
chase(24, 10n)
chase(14, 7n2 + 1)
chase(14, 15n2 + 2)
chase(13, 7 div n)
chase(17, 7 div n)
chase(11, 3n div 2)
chase(10, 3n2)
chase(13, 11n3)
chase(14, 3n3)
chase(14, 10n x log(v))