Henry Ernest Dudeney/Puzzles and Curious Problems/91 - Squaring the Digits

by : $91$

 * Squaring the Digits
 * Take $9$ counters numbered $1$ to $9$, and place them in a row: $1$, $2$, $3$, $4$, $5$, $6$, $7$, $8$, $9$.
 * It is required in as few exchanges of pairs as possible to convert this into a square number.


 * As an example in $6$ pairs we give the following:
 * $\tuple {7, 8}$ (exchanging $7$ and $8$),
 * $\tuple {8, 4}$, $\tuple {4, 6}$, $\tuple {6, 9}$, $\tuple {9, 3}$, $\tuple {3, 2}$, which gives us the number $139 \, 854 \, 276$,
 * which is the square of $11 \, 826$.
 * But it can be done in much fewer moves.