A toy box of numbers

Binary, the prime sieve, the Josephus problem and the Collatz conjecture, plus three classic move-and-think puzzles. A small history of number play, and some surprising links.

Numbers make good toys: binary, primes, people leaving a circle, a number that finds its way back to 1. Add classic puzzles you move and think about. Seven works, linked by short stories.

Binary Cards (the site’s “Binary Cards”)

Think of a number from 1 to 63, answer “Yes” or “No” to six cards, and the number is found. The top-left numbers on the cards are 32, 16, 8, 4, 2 and 1. Add up those on the cards you said “Yes” to and you get your number. Every number has exactly one combination of cards. That is binary, the way of writing numbers with only 0 and 1, one digit per card.

Leibniz sent a paper explaining binary arithmetic to the Royal Academy of Sciences in Paris. The volume is dated 1703 and was printed in 1705. The missionary Bouvet, in China, wrote that the diagram of the 64 hexagrams of the I Ching matches an ordering of binary numbers. Leibniz read it as the same thing as his own binary. But it cannot be said that the I Ching was binary. That is how Leibniz read it. Leibniz also was not the first to think of binary; there were predecessors. He is one who tidied binary up as mathematics and spread it.

Prime Sieve (the site’s “Prime Sieve”)

Cross out the multiples of 2, then of 3, then of 5, and so on from a table of numbers; what survives is the primes. There are 25 primes up to 100 and 78 up to 400. This site’s program checked both. Up to 100, it is enough to cross out multiples of 2, 3, 5 and 7, because the square root of 100 is 10. Up to 400, the eight primes up to 20 (2, 3, 5, 7, 11, 13, 17, 19) are enough. The program checked this too.

The name “Sieve of Eratosthenes” appears in a book by Nicomachus from the early 2nd century. He passes the method on as Eratosthenes’s, from the 3rd century BC. Whether Eratosthenes himself devised it cannot be said for sure.

Circle Elimination (the site’s “Circle Elimination”)

People stand in a circle and every so often one leaves. Who is left at the end? This is called the Josephus problem. When every other person leaves, write the number of people in binary and move the leading 1 to the end: you get the survivor. For 41 people, 101001 becomes 010011, which is person 19. The program checked this relation for group sizes up to 1000. When the group is a power of two (2, 4, 8, 16, …), person 1 always survives. This links back to the binary cards.

Josephus, who gives the problem its name, was a Jewish historian of the first century. In his own account, after hiding in a cave with companions, they drew lots to decide the order of their own deaths. That he and one other remained at the end, he wrote, might be “by chance, or by the providence of God.” There is no circle and no counting in that account. The problem was tidied into a circle with a counting step in a later age; a problem in Bachet’s book of 1612 is given as an example.

Hailstone Numbers (the site’s “Hailstone Numbers”)

Halve it if it is even; triple it and add one if it is odd. Repeat. Does every number come back to 1? This is the Collatz conjecture, said to have been asked by Lothar Collatz in 1937. Start at 27: it climbs to 9232, then returns to 1 in 111 steps. Among starts below 1000, the longest trip is 871, at 178 steps. This site’s program also checked that every start from 1 to 99999 returns to 1. The longest trip among them is 350 steps.

The conjecture is still unsolved. As of a paper published in 2025, computers have verified all starts below about 2.4 × 1021 (2 to the power 71). That record will surely be broken in time. But no number of checked cases amounts to a proof that it holds for every number.

Frog Leap (the site’s “Frog Leap”)

Green and brown frogs face each other in a line. They only go forward: onto the empty pad, or over one neighbour. The goal is to swap the two sides. It is a long-known puzzle. One frog each takes 3 moves, two each take 8, three each take 15. For n frogs a side the minimum is n × n + 2n moves. This site’s program checked n = 1 to 5. That is n × n hops and 2n steps. Because nothing can go back, there are positions from which the puzzle can never be finished.

Peg Solitaire (the site’s “Peg Solitaire”)

You jump over a peg to remove it, shrinking the pegs on the board. On the 33-hole cross board, starting with only the centre empty, 31 jumps can leave a single peg. There is also a way to leave that last peg in the centre. On the 15-hole triangle, whichever hole you empty first, 13 jumps can leave one peg. This site’s program checked all 15 starting holes.

The earliest solid trace is said to be an engraving of 1697 showing a lady of the court of Louis XIV holding a board. Leibniz is also said to have mentioned the game in 1710. The story that “a prisoner in the Bastille invented it” is said to rest on weak ground. It first appears in 1810, over a hundred years after the supposed time.

Torch Across the Bridge (the site’s “Torch Across the Bridge”)

Cross a bridge at night with one torch. The bridge holds two, and a pair goes at the slower person’s speed. For people taking 1, 2, 5 and 10 minutes, the best total is 17 minutes. The plan where the fastest person escorts everyone takes 19. Sending the two slowest together is the key to 17. Intuition is a little bit of a trap here. The search on this site agrees with a well-known formula over many sets of times.

For four people (A, B, C, D from fastest to slowest), the best total is said to be the smaller of 2A + B + C + D and A + 3B + D (as organised by Rote in 2002). In the example, the smaller is A + 3B + D: 1 + 6 + 10 = 17. The origin is unclear. All that can be said is that an example appears in a book of 1981.

All of them are about noticing a pattern

  • Binary and Josephus: write the number in binary and a rule appears.
  • Sieve: notice that the square root is enough, and the work shrinks.
  • Collatz: easy to test, still without a proof.
  • Frog Leap and Peg Solitaire: some moves cannot be undone, so look ahead.
  • Bridge crossing: doubt the instinct to keep reusing the fastest person.

In each of these works, hints begin with the idea. Try just that first.

Sources

Updated: 2026-10-17