Use logical deduction to place a different digit from 1 to 9 in each circle below so that 8 of the arrows form the primes 23, 31, 41, 53, 59, 79, 89, and 97. (We view an arrow starting at digit A and ending at digit B as forming the 2-digit number AB.)
Then find a path traversing each arrow exactly once so that the first visit to a circle leaves by its southeast exit, and every subsequent visit leaves by its next exit, going clockwise. What sequence of digits do you get?
Bonus: Extend the sequence by adding the next arrow; inevitably, it will cross over other arrows. Can you rearrange the circles and arrows so that once again no arrows cross? (Pretend we're drawing points and curved lines in the plane—no lateral-thinking.)
The colors are simultaneously a subtle verification of the first part, a not-so-subtle hint for the bonus, and an Easter egg.