Problem

Source: OMEC Ecuador National Olympiad Final Round 2020 N3 P6 day 2

Tags: combinatorics



A board $1$x$k$ is called guayaco if: -Each unit square is painted with exactly one of $k$ available colors. -If $gcd(i,k)>1$, the $i$th unit square is painted with the same color as $(i-1)$th unit square. -If $gcd(i, k)=1$, the $i$th unit square is painted with the same color as $(k-i)$th unit square. Sebastian chooses a positive integer $a$ and calculates the number of boards $1$x$a$ that are guayacos. After that, David chooses a positive integer $b$ and calculates the number of boards $1$x$b$ that are guayacos. David wins if the number of boards $1$x$a$ that are guayacos is the same as the number of boards $1$x$b$ that are guayacos, otherwise, Sebastian wins. Find all the pairs $(a,b) $ such that, with those numbers, David wins.