Four Fours
Introduction

Contents

About Four Fours

Four Fours is a mathematical challenge that can be explored to many levels. If you are new to this puzzle, you should take on the First Challenge below. If you like Four Fours, or have suggestions, please use the feedback form.

The Four Challenges

  1. The First Challenge is to find the Four Fours terms for numbers 0 to 19, using only your brain to assist with the calculations. You will only need to use the Basic Rules to achieve this.
  2. The Second Challenge is to find the Four Fours terms for 20 to 99. Use of a calculator is allowed. You will need the Basic Rules, and Advanced Rules to achieve this.
  3. The Third Challenge is to write a computer program to find Four Fours terms for other numbers, using the Basic Rules and Advanced Rules. You will need access to programming resources to achieve this.
  4. The Fourth Challenge is to write a computer algorithm that will know whether a Four Fours term is possible for any given integer in the most efficient way possible, e.g. without looking up pre-computed four fours solutions, or without the combinatorial number-crunching required to solve the Third Challenge.

See Education for ideas on how to turn any of these challenges into an educational resource.

First Challenge: Basic Rules

The First Challenge is to find answers for the whole numbers 0 to 19, using the Basic Rules (below).

If you're really stuck, Solutions have been submitted by the Web community.

Basic Rules

A number is chosen, for example, '1'. Using only four '4's, i.e. 4, 4, 4, and 4, with any number of operators and parentheses, you must arrive at the chosen solution. For example,

0 = (4+4) – (4+4)
1 = (4/4) / (4/4)

OK, that's 0 and 1 done, what about the rest? All numbers are now open for suggestions. As the web community submits solutions, gaps in the sequence will become apparrent – the challenge is to fill these gaps!

Basic operators to start you off:

  • addition, +
  • subtraction, –
  • multiplication, *
  • division, ÷, shown here as /
  • x raised to the power n, xn, shown here as x^n
    note that x and n must both be constructed using the other rules.

Second Challenge: Advanced Rules

The Second Challenge is to find answers for the whole numbers 20 to 99. You may use the Advanced Rules (below).

If you're really stuck, Solutions have been submitted by the Web community. These solutions do not stop at 99, and other puzzlers have used the Third Challenge to achieve solutions to 40,000 and beyond, using different rules.

Advanced Rules

The detailed rules below will become more important as you progress to larger numbers.

  1. Some solutions use .4~, conventionally written as '4' with a dot above. This is probably stretching the rules, in that it represents 0.444444, but we'll allow it.
  2. You may use factorial postfix !, e.g. 4! to represent 24.
  3. You may use the 'square root' operator, sqrt(), e.g. sqrt(4) to represent 2.
  4. Use of .(anything) is not allowed, e.g. .(4!) to represent 0.24. This is bad syntax.
  5. Likewise, use of (anything)% is not allowed, e.g. (44)% to represent 0.44.
  6. Use of 4% to represent 0.04 is stretching the rules. Answers using 4% will be accepted, but I'll replace it in preference of an alternative solution that does not use 4%.
  7. 'Raising to the power -1', 1/x, or the use of a reciprocal function is not allowed, because this is direct use of the number 1. e.g. 4-1 or ¼ to represent 0.25.
  8. Functions that change the purity of arguments are not permitted, e.g. int(), ceil(), floor(), frac(), etc., as these are equivalent to approximations. They basically 'fudge' the answer, so are not allowed.
  9. You may not use the log function, as that would mean you'd be able to find every solution by nesting log and sqrt.
  10. You may not use numeric constants (other than 4), e.g. π (pi), or e (natural logarithm base) are not allowed.