MathDB
Math Prize 2021 Problem 11

Source:

September 19, 2021
Math Prize for Girlsnumber theoryrelatively prime

Problem Statement

Say that a sequence a1a_1, a2a_2, a3a_3, a4a_4, a5a_5, a6a_6, a7a_7, a8a_8 is cool if * the sequence contains each of the integers 1 through 8 exactly once, and * every pair of consecutive terms in the sequence are relatively prime. In other words, a1a_1 and a2a_2 are relatively prime, a2a_2 and a3a_3 are relatively prime, \ldots, and a7a_7 and a8a_8 are relatively prime.
How many cool sequences are there?