Tags Math

There's a cute math puzzle that can be interesting to folks on very different levels:

Given exactly four instances of the digit 2 and some target natural number, use any mathematical operations to generate the target number with these 2s, using no other digits.

Some examples can be done by elementary school kids:

\[\begin{align*} 1&=\frac{2+2}{2+2}\\ 2&=\frac{2}{2}+\frac{2}{2}\\ 3&=2\cdot2-\frac{2}{2}\\ 4&=2+2+2-2\\ 5&=2\cdot 2 +\frac{2}{2}\\ 6&=2\cdot 2\cdot 2 - 2\\ \end{align*}\]

In middle school, kids learn about exponents, factorials, etc. which expands the range considerably:

\[\begin{align*} 18&=2^{2^{2}}+2\\ 28&=(2+2)!+2+2\\ 256&=(2+2)^{2+2}\\ 65536&=2^{2^{2^{2}}}\\ \end{align*}\]

Then come the tricks; for example, the number 22 (twenty two) can be seen as a valid use of two 2s, and so on; so we can have:

\[\begin{align*} 26&=22+2+2\\ 11&=\frac{22}{\sqrt{2+2}}\\ 444&=222\cdot 2\\ \end{align*}\]

Getting to 7 is notoriously difficult, but if you allow even more mathematical tools like the Gamma function, it becomes easy:

\[7&=\Gamma(2)+2+2+2\]

The more math skill people have, the more numbers they can make. See this thread for some fun concoctions using integrals, repeating fractions and combinatorial operators. One of my favorite examples involves complex numbers:

\[12=|2+2\sqrt{-2}|^2\]

So the fun doesn't end even after one graduates from university! In fact, this seems to have been a favorite pastime for mathematicians in the 1920s. Until Paul Dirac ruined it for everyone by finding a general solution for every number.

It's all about nested square roots:

\[\begin{align*} \sqrt{2}=2^{\frac{1}{2}}=2^{2^{-1}}\\ \sqrt{\sqrt{2}}=2^{\frac{1}{4}}=2^{2^{-2}}\\ \sqrt{\sqrt{\sqrt{2}}}=2^{\frac{1}{8}}=2^{2^{-3}}\\ \end{align*}\]

If the square root is applied n times:

\[\sqrt{\sqrt{\cdots n \cdots\sqrt{2}}}=2^{2^{(-n)}}\]

All that's left now is some base-2 logarithms:

\[log_{2}2^{2^{(-n)}}=2^{(-n)}\]

And another:

\[log_{2}(log_{2}2^{2^{(-n)}})=-n\]

This leads to the general formula:

\[n = -log_{2}\left(log_{2}\left(\sqrt{\sqrt{\cdots n \cdots\sqrt{2}}}\right)\right)\]

There's just one small wrinkle: it uses three instances of the digit 2, not four. This is easy to amend, however; since 2=\sqrt{2+2}, we can replace any single digit with that and get exactly four:

\[n = -log_{\sqrt{2+2}}\left(log_{2}\left(\sqrt{\sqrt{\cdots n \cdots\sqrt{2}}}\right)\right)\]

One may claim this is cheating, but it seems to be in line with the rules of the puzzle! Note that the entity n doesn't actually appear anywhere - it's just a helper to count the number of repeated square roots. For example, another way to express 7 is:

\[7=-log_{\sqrt{2+2}}\left(log_{2}\left( \sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{2}}}}}}}\right)\right)\]

There are exactly four 2s, and this uses only reasonable, elemental math operations to do the calculation. It's clear that any number can be expressed this way; the only challenge is properly drawing all those square roots!

Credits

I've read about this story in Graham Farmelo's book The Strangest Man: The Hidden Life of Paul Dirac, Quantum Genius. I'm enjoying this book so far.