## Number Games

Ed Pegg Jr., March 1, 2004

In 1892, W W Rouse Ball published the four 4's problem in his classic "Mathematical Recreations and Essays".  I see many odd variations of the problem, usually sent to me by desperate students.  The answers usually aren't given in the rec.puzzles FAQ.

One group of problems comes from Point 24, a card game.  Two or more people gather around a table.  Four cards are displayed at a time, with face cards being 10. Everyone tries to reach 24 by combining these four numbers with operators + − × ÷ and parentheses. The one who gets the solution fastest taps the table to announce it. If the solution is correct, he/she can collect the cards on the table. Whoever gathers the most cards wins.  Can you get Point 24 with cards 3, 3, 8, and 8?  (Answer).  The game of Krypto is related to this. To make your own deck, write 1-25 twice on index cards.

In the four 4's problem itself, the object is to use the simplest possible mathematical notations to represent all the numbers from 1 to 112.  For example, 44/4+4 = 15, .4*(44-4) = 16, 4/4+4*4 = 17.  The number 113 requires more advanced notations.  (Answer for 113 via the gamma function). Several sites discuss the problem.  David Wheeler's definitive four fours answer key features solutions up to 40000.  Paul Bourke's four four problem page maintains a list of solutions up to 9370240, along with explanations of the various notation tricks that can be used.  Steven J. Wilson's Integermania page has an incomplete set of solutions up to a googol, along with several related problems.  He also defines the notion of exquisiteness -- a measure of how nice a solution is.

The most difficult problems of this type I see involve using all of the digits, along with some arrangement of blanks. For example, substitute the digits 1 to 9 for the letters a to i in a/bc + c/de + f/gh = 1 to make a true statement. (Answer).  I saw a more difficult version of this problem given to fourth graders.  Solve (a × bc + d/e)/(fg + h/i) = 50, with digits 1 to 9 for the letters a to i. (Answer.)  I used a brute force method.  I asked the teacher to solve (a × bc + d/e)/(fg + h/i) = 40 under the same criteria, but never heard back.

The operators can be constrained.  The complexity of n is sometimes defined as the number of 1's required to build n using + and ×.   This is sequence A005445 in OEIS.  Twelve can be represented as (1+1+1+1)×(1+1+1), so the complexity of 12 is 7.  Finding the complexity of 2004 is quite tricky.

Sometimes, the numbers and symbols are given.  Last year, Yoshio Mimura offered this:   1 2 3 4 5 6 7 8 = 2003.  Add each of +, −, ×, ÷ exactly once to make the equation true. Answer.  There are many puzzles of this type.

For this year, Erich Friedman suggested representing 2004 with a minimal number of some digit.  I received many answers.

(0!+0!)*(0!+0!+(0!+(0!+0!+0!)^(0!+0!))^(0!+0!+0!)) = 2004 Boris Alexeev
(0!+0!+0!+0!)*(0!+(0!+0!+0!+0!)*(0!+0!+0!+0!+0!)^(0!+0!+0!)) = 2004 Juha Saukkola

(1111-111+1+1)*(1+1)       == 2004; Matt Jones, Juha Saukkola
(1+1)^11-11*(1+1)^(1+1)    == 2004; Philippe Fondanaiche
(1+1)*(1+1+(11-1)^(1+1+1)) == 2004; Boris Alexee

sqrt(2^22)-2*22            == 2004; Boris Alexeev, Aad van de Wetering
ceil(((2*2)!^sqrt(2)/2)^2) == 2004; Boris Alexeev
2^(22/2)-2*22              == 2004; Erich Friedman

333*3!+3!                  == 2004; Boris Alexeev
3+floor(3!^sqrt(3* 3!))    == 2004; Boris Alexeev
(333+3/3)*(3+3)            == 2004; Erich Friedman
(3!^3-3)*3!+3!!+3!         == 2004; Aad van de Wetering

sqrt(sqrt(4^4!))/sqrt4-44  == 2004; Boris Alexeev
ceil(4!^sqrt(4+4)/4)       == 2004; Boris Alexeev
(4+4)*4^4-44               == 2004; Philippe Fondanaiche, Gaurav Singhal
((4^4)*4-4!+sqrt4)*sqrt4   == 2004; Aad van de Wetering

5+5!/5+5*(5*55+5!)         == 2004; Boris Alexeev
ceil(sqrt(sqrt5^5)*floor(5!*sqrt5))    == 2004; Boris Alexeev
5*5*5*(5+5+5+(5/5))+5-(5/5)== 2004; Matt Jones

6*6*6*6+6!-6-6             == 2004; Boris Alexeev
ceil((6-sqrt6)^6)          == 2004; Boris Alexeev
((6+6+6)/6)*666+6          == 2004; Erich Friedman
6!+(sqrt(6^6))*6-6-6       == 2004; Aad van de Wetering

7+77+(7!+7!*7)/(7+7+7)      == 2004; Boris Alexeev
floor(sqrt7+sqrt(sqrt77^7)) == 2004; Boris Alexeev
((7*7-7)*7-7)*7-7+(7+7)/7   == 2004; Philippe Fondanaiche
7*7*7*7-7*7*7-7*7-7+(7+7)/7 == 2004; Juha Saukkola

(8!-8*8)/(8+8)-8*8*8        == 2004; Boris Alexeev
sqrt(8+8)*(sqrt(8^8)-88)/8  == 2004; Boris Alexeev
(8*8*8*8-88)*8/(8+8)        == 2004; Philippe Fondanaiche
(sqrt(8^8)-88)/(sqrtsqrt(8+8)) == 2004; Aad van de Wetering

(999+(9+9+9)/9)*(9+9)/9     == 2004; Philippe Fondanaiche
9!/(9*9+99)-sqrt9-9         == 2004; Boris Alexeev
ceil(9^sqrt(9+sqrt9))-9-9   == 2004; Boris Alexeev
(99*(9+9))+((999/9)*((99/9)-9)) == 2004; Matt Jones
999+999+9-(9+9+9)/9         == 2004; Juha Saukkola
999+999+9-sqrt9             == 2004; Juha Saukkola
999*((9+9)/9)+((9+9)*9/(9+9+9)) == 2004; Sudeepth Jeevan
(((sqrt9)!^sqrt9)+(sqrt9)!)*9)+(sqrt9)!  == 2004; Aad van de Wetering

The ultimate minimization of digits was done by Roger Phillips.  He was able to represent 2004 with a single 5, via

120 = fac(5)
36 = ceil(sqr(sqr(sqr(sqr(sqr(sqr(sqr(fac(120)))))))))
397 = ceil(sqr(sqr(sqr(sqr(fac(36))))))
2308 = floor(sqr(sqr(sqr(sqr(sqr(sqr(sqr(sqr(fac(397))))))))))
2004 = ceil(sqr(sqr(sqr(sqr(sqr(sqr(sqr(sqr(sqr(sqr(sqr(fac(2308)))))))))))))

My favorite 2004 answer is , by Boris Alexeev.  By Steven Wilson's exquisiteness criteria, the fact that it uses a rounding function are the worst thing you can use.  I like them, though.  For arithmetic I need to do in my head, I'd rather deal with a rounding function.

References:

Paul Bourke, Four Four Problems, http://astronomy.swin.edu.au/~pbourke/fun/4444/.

Zhe Hu, Combinatorial Card Games: Point 24 and Krypto, http://library.wolfram.com/infocenter/MathSource/5131/.

Yoshio Mimura, Math Is Fun, http://www.kobepharma-u.ac.jp/%7Emath/index.html.

Ed Pegg Jr, 2004 Solutions, http://www.mathpuzzle.com/2004.txt.

David Wheeler, The Definitive Four Fours Answer Key, http://www.dwheeler.com/fourfours/.

Steven J. Wilson, IntegerMania, http://staff.jccc.net/swilson/integermania/exquisiteness.htm.

Stephen Wolfram, Operator representations, NKS|Online, http://www.wolframscience.com/nksonline/page-916.

Mathematica Code for the (a × bc + d/e)/(fg + h/i) = 50 problem:

jj = Permutations[Range];
integersols = Table[If[IntegerQ[prob[jj[[kk]]]],prob[jj[[kk]]],{}],{kk,1, Length[jj]}];
Position[integersols, 50]
jj[]