n = 12 = (11) × (101) × 100,010,001
n = 16 = (11) × (101) × 1,000,100,010,001.
When n = 2, we have the prime number 11; when n = 3, the factors are 3 . 37; when n = 6, they are 11 . 3 . 37 . 7. 13; when n = 9, they are 32 . 37 . 333,667. Therefore we know that factors of n = 18 are 11. 32 . 37 . 7 . 13 . 333,667, while the remaining factor is composite and can be split into 19 . 52579. This will show how the working may be simplified when n is not prime.
[48].—The Riddle of the Frogs' Ring.
The fewest possible moves in which this puzzle can be solved are 118. I will give the complete solution. The black figures on white discs move in the directions of the hands of a clock, and the white figures on black discs the other way. The following are the numbers in the order in which they move. Whether you have to make a simple move or a leaping move will be clear from the position, as you never can have an alternative. The moves enclosed in brackets are to be played five times over: 6, 7, 8, 6, 5, 4, 7, 8, 9, 10, 6, 5, 4, 3, 2, 7, 8, 9, 10, 11 (6, 5, 4, 3, 2, 1), 6, 5, 4, 3, 2, 12, (7, 8, 9, 10, 11, 12), 7, 8, 9, 10, 11, 1, 6, 5, 4, 3, 2, 12, 7, 8, 9, 10, 11, 6, 5, 4, 3, 2, 8, 9, 10, 11, 4, 3, 2, 10, 11, 2. We thus have made 118 moves within the conditions, the black frogs have changed places with the white ones, and 1 and 12 are side by side in the positions stipulated.
The general solution in the case of this puzzle is 3n2 + 2n - 2 moves, where the number of frogs of each colour is n. The law governing the sequence of moves is easily discovered by an examination of the simpler cases, where n = 2, 3, and 4.
If, instead of 11 and 12 changing places, the 6 and 7 must interchange, the expression is n2 + 4n + 2 moves. If we give n the value 6, as in the example of the Frogs' Ring, the number of moves would be 62.
For a general solution of the case where frogs of one colour reverse their order, leaving the blank space in the same position, and each frog is allowed to be moved in either direction (leaping, of course, over his own colour), see "The Grasshopper Puzzle" in A. in M., p. 193.