© Copyright 1998 by Heiner Marxen

The Year Puzzle



Usually, the "Year Puzzle" challanges you to connect the four digits of the current year (in that order) with the usual arithmetic operators, in order to form expressions which yield all the values from (say) 1 to 100.

The "Four 4's" puzzle is exactly the same for the year 4444. Both forms have appeared repeatedly e.g. in the news group sci.math.

While this puzzle is fun for the beginner, discussing the more difficult cases (how do you build a 39 with four 4's?) rapidly exhibit the need for more exact rules of the game. There seems to be no generally accepted rule set.

The Rules of the Puzzle

The following rules seem to be generally accepted:

The following rules seem to be accepted by most, but not all: The following rules seem to be accepted by some, but not many (I like them): The following operators are generally not accepted. Some operator combinations even allow to systematically construct all numbers, which makes the puzzle quite boring.

My Approach

When I first tried to solve the four 4's with paper and pencil, I failed to find solutions for such small values as 33 and 39. Then I started to systematically list all partial expressions with just two of the four fours and to tabulate the resulting values. I soon realized that this is a job for a computer program, not for a programmer :-). Hence I started to write a program, which should perform that systematic search. I used "awk" (i.e. "nawk") for it, and I have extended the first experimental version since then, such that I am very satisfied with the results. A few minutes on a typical workstation are enough to yield a list of solutions, which is as complete as I could do myself.

No, sorry, my awk program is not in the public domain. But I'll share some of my ideas. Let's take "1998" as an example.

Exponentiation with rational numbers may be a bit tricky. This pretty much sums up my method.

My Results

I let my awk program run for some of the interesting years, for the four 4's, and also for four other digits. You can look at the respective output, for the range 0-200.

Other Resources (English)

Other Resources (German and Dutch)

I appreciate to receive suggestions and hints to further resources.
Back to the Puzzle Overview.
Back to the home page of Heiner Marxen.
$Date: 2008/06/02 19:21:13 $