The Definitive Four Fours Answer Key

This is the home page of ``The Definitive Four Fours Answer Key'' by David A. Wheeler. I call it the ``definitive'' answer key, because at the time of this writing it has more answers than anybody else for the ``four fours'' problem. The goal of the four fours problem is to find a mathematical expression for every integer from 0 to some maximum positive integer, using only common mathematical symbols and exactly four fours (no other digits are allowed). For example, zero is 44-44, one is 44/44, 2 is 4/4+4/4, 3 is (4+4+4)/4, and so on. Since there are variations in what mathematical operations are allowed, I created an ``impurity index'' for each expression; see the paper for more information.

Currently, I list whole number answers from 0 up to 40,000.

You can download the definitive four fours answer key, with discussion, in PDF format. If you just want the answers, I also have them available in ASCII text format (which lists the result, the impurity level, and the mathematical expression). Note that these are large files; both are over 1.6 Megabytes, so don't load these if you have a slow Internet connection.

If you just want a sampler of the answers, you can view the abbreviated list of answers; this one is the ASCII text format of the answers from 0 to 1,000. This sampler is only about 32K, and is better for those with slow Internet connections.

See the PDF version of the paper for a detailed description of my assumptions. However, here's a quick summary of the ``impurity'' levels. The ``zeroth'' level allows addition (+), subtraction/negation (-), multiplication (*), division (/), square root (sqrt), factorial (!), and power (^). Parentheses may be used for grouping. The digit 4 must be used exactly four times, and the decimal digit (.) can be used. The higher impurity levels are:

I always choose the solution with the smallest impurity, then the fewest number of operations with that impurity.

Some of these solutions are incredibly difficult to find otherwise. For example, solutions for 113 and 123 are incredibly hard to find. Here are my solutions for 113 and 123:

  113 = gamma(gamma(4))-(4!+4)/4
  123 = sqrt(sqrt(sqrt((sqrt(4)/.4)^4!)))-sqrt(4)

(It turns out that element 113 is hard to find too.)

Some people have sent me a few minor additions. I intend to fold them in eventually, but for now, they are:

239 (0) = ((4! * 4) - .4) / .4       [Jay N. Giedd]
990 = 44/(.4~-.4)                    [Roger Webber]
951 = 4!*(4!+sqrt(sqrt(sqrt(.4^(-4!)))))     [Roger Webber]

Other sites that discuss the four fours problem include the comp-sci collection, Paul Bourke's collection (with Frank Mrazik) (but note that some solutions use non-standard notation!), the collection of ``interesting'' solutions at wheels.org, and the Math Forum/Ruth Carter's list at Pete Karsanow's Four Fours FAQ. There is also a page emphasizing solutions based on the book for Texas Instruments (TI) calculators (note: this site has download limitations and sometimes isn't available). Mathnet discusses the Four Fours Problem too. Note that there are many variations in the rules (e.g., some allow fewer than four fours, or different operations). Heiner discusses a variant called the ``year puzzle.''

The first known occurrence of this puzzle in print is in "Mathematical Recreations and Essays" by W. W. Rouse Ball, published in 1892. Ball describes it as a "traditional recreation".

Enjoy!! If you want, feel free to See my home page.