Pick a Number ...

This post first appeared 14 August 2023.

… any number.

You’ll probably want this number to have three or four digits. Fewer might be boring and more may get a bit complicated.

If you don’t feel like working through this trick open the example boxes. It’s really better if you do it yourself (the first time) though.

Example Let’s choose $5701$.

Let’s say the number has $n$ digits. We are going to make $n$ “layers” of numbers. The first layer only has one number in it: the number you chose.

Copy this number into the second layer too. The other number in the second layer is a “flipped” version of your chosen number. To do this, take off the most significant digit of your number and subtract the rest. So if you chose $2345$, calculate $2000 - 345 = 1655$. These two numbers form the second layer.

Example

We expect to have four layers. Our first two look like this:

Layer Numbers Notes
1st $\left\{5701\right\}$ The chosen number
2nd $\left\{5701,4299\right\}$ $5000-701 = 4299$

Repeat this process to get the $(i+1)$th layer from the $i$th: first copy down all the numbers in the $i$th layer into the $(i+1)$th. Then add all the numbers “flipped” at the $i$th digit. So to go from layer two to three with the number $2345$ we also add $2300 - 45$. If we were going from layer 3 to layer 4 we’d add $2340-5 =2335$.

One other thing: don’t do this if the $i$th digit is 0. So you can’t flip the number $2034$ at the $2$nd digit to get $2000 - 34$. Also, if you ever end up with duplicate values in a layer, just ignore them.

Example

We can fill in the rest of the layers:

Layer Numbers Notes
1st $\left\{5701\right\}$ The chosen number
2nd $\left\{5701,4299\right\}$ $5000-701 = 4299$
3rd $\left\{5701,5699,4299,4101\right\}$ $5700-1 = 5699$ and $4200-99=4101$
4th $\left\{5701,5699,5681,4299,4281,4101\right\}$ We ignore $5700-1 = 5699$ and $4100-1=4099$ because we have a rule not to flip if the flipping digit is zero.

Once this is done, you should end up with quite a few numbers in the $n$th layer. For each of these numbers, perform the following operation:

  1. Subtract $1$
  2. Add one to each of the digits
  3. Multiply these together

So if the number $2340$ was in the last layer, we look at $2339$, add one to each of the digits to get $3$, $4$, $4$ and $10$ and multiply these together to get $480$.

Example

The last layer was $\left\{5701,5699,5681,4299,4281,4101\right\}$. Here is the result of the digit operation:

Number Result of operation
$5701$ $5701-1=5700$ so we add 1 to each digit and multiply to get $6\times 8\times 1 \times 1 = 48$
$5699$ $5699-1=5698$ so we calculate $6\times 7\times 10\times 9 = 3780$
$5681$ $5681-1=5680$ so we calculate $6\times 7\times 9\times 1 = 378$
$4299$ $4299-1=4298$ so we calculate $5\times 3\times 10\times 9 = 1350$
$4281$ $4281-1=4280$ so we calculate $5\times 3\times 9\times 1 = 135$
$4101$ $4101-1=4100$ so we calculate $5\times 2\times 1\times 1 = 10$

Finally, add all the numbers from the last step together…

Example $$48+ 3780+378+1350+135+10=5701$$

Is this your number?


If I’m honest. I don’t know why this works.

The game is reminiscent of the “pick a number, any number” or “shoe size trick”. In that incarnation, you are asked to think of any number (which we’ll call $x$), double it (to get $2x$), add sixteen (for $2x+16$), then divide by two (now $x+8$) before subtracting the number you originally thought of. Its moderately unsurprising that you end up with 81.

I, together with a co-author, have a proof2 that this works if you write numbers base $p$, but not base 10 as we’ve done above. Even then its a very fiddly and complicated proof. An outline is as follows:

  1. We construct a particular vector space (or “module”) of dimension $n$ called $V_n$.
  2. We then write it as the direct sum of a bunch of other modules called $U_i$ where the $i$ are those numbers appearing in the last layer above: $V_n = \bigoplus_i U_i$.
  3. Then we show that the strange digit operation gives the dimension of $U_i$ (so $U_{230} = 3\times 4\times 1 = 12$).
  4. Since the direct sum simply sums the dimensions we have the result: $n = \dim V_n = \sum_i \dim U_i$.

However, this brushes a ton of representation theory under the carpet. I’d love to hear any explanation for why this works that doesn’t use high powered maths.


  1. Incidentally, my friends and I once short-circuited a escape room puzzle by doing the algebra instead of the arithmetic. The GM was rather confused… ↩︎

  2. See Remark 19 here↩︎