The Towers of Hanoi Rainbow Problem: Coloring the Rings

Abstract A variation of the classical Towers of Hanoi problem, in which rings of the same color cannot come in contact with each other, is solved via a simple recursive algorithm. This algorithm turns out to be optimal for a wide variety of colorings, but not for all colorings. A second algorithm, which resorts to trial computations but which is optimal in both ring moves and order of execution time, is also presented. In analyzing both of these algorithms, particular emphasis is placed on the case in which the rings are alternately colored using M colors.