Home / Pete's stuff / Not computer games / Four Fours FAQ

**CSS functionality missing:**
This site will appear closer to the author's intent in a browser that supports web standards,
but it is accessible to any browser or Internet device.
If you can read this, CSS (style sheets) is essentially disabled on this page,
thus degrading the presentation but not losing any content.
That's due to either the CSS file being unavailable from the server,
your browser failing to understand it, or viewing in a medium besides a browser screen.

If this page is displayed in a frame, which should happen only when the Geocities/Yahoo server puts them there and not because some other site is displaying my content, please reload this page to bust out of them.

This is a FAQ for the "four fours" mathematical puzzle, specifically concentrating on the version found in a book for Texas Instruments (TI) calculators.

Revision History:

XHTML tweaks without changes to FAQ content are not shown. | |

2005-08-02: | - Sneaky general solution found to rely on an undocumented operation in Windows Calculator Accessory. - Added trademark reference for Microsoft to Legal section. - Added the "correct" multiplication and subtraction symbols to the notation section. - Changed notation for repeating decimal 4. - Minor editing throughout. - Added "Help me with mine!". - Added a link to David Wheeler's "The Definitive Four Fours Answer Key". |

2003-01-31: | - Minor tweaks to section 1. - I've been informed of a really old version of this problem, and I need to confirm that and get the details. |

2002-10-15: | - The "200 Up" program just had a major revision, and I finally tried it out. I really should do a VB6 program for this version of the problem, which will be sometime after I finally find the VB6 box again… |

2002-10-10: | - Removed the (now broken) link to a 1995 computer science exam that mentioned the problem, but only said that 4^(4^4) is a number with 155 digits. |

2002-09-25: | - I got a copy of the program (called Telraam) mentioned on 2002-07-14, but it's in Dutch. While the author was kind enough to translate it for me, his website doesn't include that translation at the moment. I actually haven't tried Telraam myself. - And I was just informed of another program ("200 Up")to work these sorts of puzzles, so I provided links to both sites in the list below. |

2002-07-14: | - Fixed my "gaps" list, because I had solutions for 205 and 338 for a while but forgot to update the list. - Was just informed of a program to do what I mentioned on 2000-03-17, but this one is more general and was actually completed by somebody. |

2002-03-07: | - one external link fixed, another removed |

2002-02-22: | - verified external links, added a few new ones |

2000-09-19: | - all links external to my site open a new window |

2000-03-24: | - worked on a "pure" version of the problem (only +-X/ allowed): got stuck at 11 - added language about symbolic numbers like π and e to problem rules |

2000-03-17: | - began work on a Visual Basic 6.0 program to combine all my QBASIC ones and do even more - tweaks to problem statement and what's not allowed - fixed typo in III.b. |

2000-03-05: | - more info in problem statement |

2000-03-02: | - found 163 using .4~^2 - changed copyright/distribution policy |

2000-02-23: | - changes regarding Bourke site, - re-found "The Man Who Counted" book report |

2000-02-12: | - Notation conventions moved ahead of "what's allowed" |

2000-01-06: | - a few minor content changes |

1999-11-03: | - changed FAQ from text to HTML - added more websites and verified them all |

1999-09-17: | - III.b. QBASIC limits and roundoff discussed - III.d. sneaky general solution improved |

1999-01-05: | - added III.d. A sneaky general solution |

1998-04-06: | - added I.d. Other instances |

1998-01-22: | - I.a. confirmed book title and other information |

1997-07-21: | - initial release as a text file |

- What is the "four fours" puzzle?
- This version's source and problem statement
- Notation conventions
- What's allowed and what isn't
- Other versions

- Has it been solved?
- The short answer
- The long answer

- Solutions
- Manual
- Computer
- Sample solutions for 1 to 100
- A sneaky general solution
- Help me with mine!

- Legal

## What is the "four fours" puzzle?

### This version's source and problem statement

The title of the original source for the version of the "puzzle" covered here is "The Great International Math on Keys Book", copyright © 1976 by Texas Instruments Incorporated, ISBN 0-89512-002-X. It's a book about neat things to do with math and calculators, primarily for Texas Instruments calculators — the simple ones that were first sold in the middle 1970s. Anyway, on page 9-8 under the heading "For Four 4's" was this deceptively short description:

Here's a brain teaser! Can you (with the help of your calculator, as needed) "build" all the whole numbers between 1 and 100 using only four 4's? Use only the + - X / ( ) . ^2 = and 4 keys on your calculator. 4!=4X3X2X1 is allowed, along with repeating decimal 4 (.4~=.4444…). The first 8 are shown below. (All the whole numbers up to 120 have been "built" with just four 4's - how many can you find?)

I'll leave out the 8 examples that followed. The calculator keys mentioned were shown using little box symbols, so the "^2" was actually a lowercase script x with a superscript 2, all inside a box, similar in appearance to "[

*x*^{2}]". These key symbols did appear just like the calculator keys, though, which made it easy to follow along if you had a TI calculator at hand. Also, the ".4~" was actually a 4 with a decimal point above it, a symbol that can't be duplicated on the World Wide Web at present. The 8 examples used a strange combination of graphic expressions and calculator key representations, and also demonstrated something not explicitly allowed in the problem statement: the use of 44, as in 1=44/44. This "gluing" has some uses.This is

**not**the only version of this puzzle. The websites listed below in "other instances" have several more, which each have their own rules, leading to quite different solutions or lack thereof.### Notation conventions

- Solutions are written such that they can fit on a single line, with as many parentheses as seem necessary to specify order of operations.
- ".4~" represents repeating decimal 4 (.444… or 4/9). The symbol used in the book was a numerical 4 with a dot above it, which can only be approximated on the World Wide Web in Unicode with 4̇ or 4˙ or 4͘, so a leading decimal point and trailing tilde were chosen as a replacement.
- "^2" represents the "square" operation (4^2=16). The symbol used in the book was a graphical representation of the calculator key that squares the current number.
- "4!" represents "4 factorial" or 24.
- "X" represents the multiplication operation; × is the correct symbol but may not work in some browsers.
- "-" represents the subtraction operation; − is the correct symbol but may not work in some browsers.

### What's allowed and what isn't

Based on the above problem statement and the 8 examples, here's what I believe is allowed in this version of the puzzle:- Unlimited addition, subtraction, multiplication, division, or squaring of operands, although only squaring is ever needed more than once on a single operand
- Parentheses as necessary to clarify order of operations
- The use of 4 factorial (4!=24) as an initial operand
- The use of repeating decimal 4 (.4~=.444…) as an initial operand (that uses up only one of your 4 fours)
- "gluing" together of multiple fours, e.g. 44, 444, and 4444, with the possible insertion of a decimal point

What isn't allowed (some of which is conjecture):- any other operations (square root, log, ln, exponentiation (x
^{y}), %, etc.) not specifically allowed - factorial of anything besides 4
- the "+/-" key, although negative values can be obtained by inserting a leading "-"
- using more or less than four 4s
- using symbolic numbers like π or
*e*

### Other versions

There are several web sites that mention other versions of this problem. They were all confirmed on 22 February 2002, but I have no control over their continued accessibility or applicability.

All of these other sites have different rules than this one. Some allow other mathematical operations. In comparison, this particular FAQ is for a rather restricted version of the problem.

- "4444 problem"

http://astronomy.swin.edu.au/~pbourke/fun/4444/

I'm on it as a contributor! A very general case of the problem. Claims "it can be proved that not all integers can be represented." The proof is apparently using some prime number theory, but the proof itself isn't immediately available. Gives some solutions for 0 to 4444, most of which are invalid for this version of the problem. Due to the different rules there, the solutions that I supplied using "(x^2)^2" become "x^4" and are thus 5 fours instead of four.

- "Question Corner -- The Four Fours Problem"

http://www.math.toronto.edu/mathnet/plain/questionCorner/fourfours.html

and http://www.math.toronto.edu/mathnet/questionCorner/fourfours.html

are practically equivalent. Makes a good point: "this puzzle depends entirely on what rules you choose." Discusses some operations that are allowed, others that are invalid for the version of the problem in this FAQ. Includes a generic complete solution using logarithms that is invalid for this version.

- "Re: Four fours problem, 3"

http://forum.swarthmore.edu/epigone/sci.math/tingsnermjand/

Archive of 10 messages comprising a sci.math newsgroup thread from October and November 1996. It gives a simple version of the problem and a few solutions. Nothing really helpful here. Some of the responses showcase the bizarre and childish things that newsgroup threads can often elicit from humanity.

- "Book Report 2.2"

http://www.gamereport.com/tgr6/bookreport.html

Among other things here is a review of a book "The Man Who Counted." Both the review and book briefly mention the problem, but only for one through ten. No real insights here.

- "Four Fours"

http://inhavision.inha.ac.kr/~leecg/four4s.htm

Has a very "pure" (restricted) version of the problem.

- comp-sci Four Fours

http://www.comp-sci.demon.co.uk/FourFours.html

Another variation on the problem, allows users to email in solutions for credit.

- another sci.math thread

http://www.math.niu.edu/~rusin/uses-math/games/krypto/4fours

This one rambles a lot, but there are some nuggets in it.

- Ruth Carver's Four 4's Puzzle

http://mathforum.org/ruth/four4s.puzzle.html

Allows bizarre operations.

- Ask Dr. Math Four 4's Puzzle

http://mathforum.org/library/drmath/view/56838.html

Where I found the above 3 links on 2002-02-22.

- Amamas Software 200 Up program

http://ourworld.compuserve.com/homepages/DavidandPenny/200Up.htm

David and Penny's "200 Up" can be used to solve arithmetic puzzles such as the four fours and 1999. The version made in October 2002 is less restrictive than before, and still well documented and easy to use. They provide solutions for versions of the problem with and without the "%" operator, with other variations from the one in this FAQ.

- Telraam program

http://members.ams.chello.nl/g.de.blaauw/telraam.html

Gerrit de Blaauw has written a highly configurable program to do four fours and similar puzzles. You'll have to email him for a translation of the controls into English, because mine is for an earlier version.

- The Definitive Four Fours Answer Key

http://www.dwheeler.com/fourfours/

David A. Wheeler's page for a very generic version of the puzzle that allows some bizarre operations, but does what it promises. Mentions the first known appearance in print of this puzzle as being in 1892. This page convinced me to change my notation to ".4~" for repeating decimal 4.

- "4444 problem"

## Has it been solved?

### The short answer

Yes.### The long answer

If you go by the exact wording of the problem statement ("all the whole numbers between 1 and 100"), the answer is yes. Sample answers for that range are listed below.

However, the true puzzle solver won't stop at just 1 to 100, when infinity beckons. And in that case, I'm afraid I have to declare victory due to exhaustion, at least within my own efforts. I expect that whatever solutions I generate for positive integers can be used to produce a negative integer as well, so less than zero is covered as well as I can do for more than zero. Zero itself is trivial, say 0=4+4-4-4. That now leaves us with how far above zero I can get! I've limited myself to a "continuous" value for my record, i.e. all integers from zero up to that value must have been solved for me to claim success at that point. That said, my current record is 182, with the first "hole" at 183.

In the interest of completeness, my next "holes" are at 187, 213, 237, 298, 302, 307, 322, 327, 339, 342 and 343. That's as far as I think we need to go for now. Computer programs have been used to generate solutions for values as high as 16383, but there are increasingly larger gaps between the values those programs obtain as the value increases.

## Solutions

### Manual

Even without a calculator, you could solve a great many values with just some scrap paper and a pen or pencil. I did just that for quite a while, and got up to 82 or so before I switched to computer solution. I don't recall the exact value that was giving me trouble, but it was definitely below 100. One note from the "pen & paper" era says that I had holes at 91, 107, 110, 130 and 131 for a while. All I can suggest to you is patience and a lot of trial and error.

### Computer

Writing a computer program (or in my case, several programs) to generate solutions for this puzzle should be attempted only after you have wrestled with "pen & paper" for a while. You need to understand why changing one operand or portion of a solution can generate a whole family of values, most of which are usually redundant with other prior solutions, but still useful for the rare occasions when a new value is solved. That said, my method is not to heuristically solve for a given value, but simply enumerate all the possible combinations of operations and operands, and catalog solutions for as many values as possible. Because I prefer short and simple programs, and each combination of parentheses and use of single or multiple 4s changes the algorithm, I wrote a family of QBASIC computer programs that run on a typical PC. Runtime is no more than several minutes (depending on your PC's speed), dependent on how many pre-calculated values you specify for multiple (2 or 3) 4s. One problem is the limited memory for an array in QBASIC; can currently only process out to 10,800 or 16,383 with current algorithm. Another problem is numerical precision; due to roundoff in fractional inputs, some calculations produce final results that aren't exact integers.

Contact me for the program files. Be sure you specify that this is in regard to the "four fours" puzzle, or I may confuse you with another group of people that ask me for information, and ignore you or send you something you don't want.

### Sample solutions for 1 to 100

Because there are many possible solutions for some of these values, I don't pretend that all those supplied below are the most elegant ones possible. I will insist that they are correct, and don't break the rules.

Solutions for 1 to 100 1 = 4-4+(4/4) 2 = (4/4)+(4/4) 3 = (4+4+4)/4 4 = 4^2/4+4-4 5 = (4X4+4)/4 6 = 4+(4+4)/4 7 = 4+4-(4/4) 8 = 4+4+4-4 9 = 4+4+(4/4) 10 = (4/.4~)+(4/4) 11 = 4^2-4-(4/4) 12 = 44-4^2-4^2 13 = 4^2-4+(4/4) 14 = 4^2-(4+4)/4 15 = (44/4)+4 16 = 44-4!-4 17 = 4X4+(4/4) 18 = 4^2+(4+4)/4 19 = 4^2+4-(4/4) 20 = 4^2+4+4-4 21 = 4^2+4+(4/4) 22 = 4!-(4+4)/4 23 = 4^2+(4!+4)/4 24 = 44-4^2-4 25 = 4^2+(4^2/.4~)/4 26 = 4!+(4+4)/4 27 = 4!+4-(4/4) 28 = 4!+4+4-4 29 = 4!+4+(4/4) 30 = (4!/4)^2-(4!/4) 31 = 4^2+4^2-(4/4) 32 = 44-4^2+4 33 = 4^2+4^2+(4/4) 34 = (4!/.4~)-4^2-4 35 = (4!/4)^2-(4/4) 36 = 44-4-4 37 = (4!/4)^2+(4/4) 38 = (4!/.4~)-4X4 39 = 4!+4^2-(4/4) 40 = 4!+4^2+4-4 41 = 4!+4^2+(4/4) 42 = (4!/.4~)-4^2+4 43 = 44-(4/4) 44 = 44+4-4 45 = 44+(4/4) 46 = 4!+4^2+(4!/4) 47 = 4!+4!-(4/4) 48 = 4!+4!+4-4 49 = 4!+4!+(4/4) 50 = 44+(4!/4) 51 = (4!/.4)-(4/.4~) 52 = 44+4+4 53 = (4!/.4~)-(4/4) 54 = (4!/.4~)+4-4 55 = (4!/.4~)+(4/4) 56 = 44+4^2-4 57 = ((4^2)^2-4!-4)/4 58 = ((4^2)^2/4)-(4!/4) 59 = (4!/.4)-(4/4) 60 = 4X(4^2-(4/4)) 61 = ((4^2)^2-4^2+4)/4 62 = ((4^2)^2-4-4)/4 63 = 4X4^2-(4/4) 64 = 44+4^2+4 65 = 4X4^2+(4/4) 66 = (4!X44)/4^2 67 = ((4^2)^2+4^2-4)/4 68 = 4X(4^2+(4/4)) 69 = ((4^2)^2+4!-4)/4 70 = ((4^2)^2/4)+(4!/4) 71 = (4/.4~)^2-(4/.4) 72 = 44+4!+4 73 = (4/.4~)+4X4^2 74 = 4+((4^2)^2+4!)/4 75 = ((4^2)^2+44)/4 76 = 44+4^2+4^2 77 = (4/.4~)^2-(4^2/4) 78 = (4!/.4~)+((4!)^2/4!) 79 = (4/.4^2)+(4!/.4~) 80 = (4^2/4)X(4^2+4) 81 = (((4+4+4)/4)^2)^2 82 = 4!+((4^2)^2-4!)/4 83 = (44/.4~)-4^2 84 = 44+4!+4^2 85 = 4+((4-(4/4))^2)^2 86 = 4^2+4^2+(4!/.4~) 87 = (4/.4~)^2+(4!/4) 88 = 44+44 89 = (4/.4~)^2+4+4 90 = 4X4!-(4!/4) 91 = (4/.4~)^2+(4/.4) 92 = 44+4!+4! 93 = (4/.4~)^2+4^2-4 94 = 4!+((4^2)^2+4!)/4 95 = 4X4!-(4/4) 96 = 4X4!+4-4 97 = 4X4!+(4/4) 98 = 44+(4!/.4~) 99 = 44X(4!/4^2)^2 100 = 4X4!+(4^2/4) ### A sneaky general solution

Although I've verified that this does NOT work on an old TI SR-56A calculator — one of the types that the book was written for — there is a general solution that works on some calculators that accept repeated use of the "=" key. On those, such as the Microsoft Windows Calculator accessory, you can do "4-4+4/4=" to get 1, then keep pressing "=" to get 2, 3, etc. However, at least in Windows 2000 Service Pack 4, the desired behavior appears only when using the "Scientific" view setting, at least for the initial entry of the operations before the "=". In "Standard" mode, the first few results from pressing "=" or the Enter key will be: 1, 0.25, 0.0625, 0.015625, etc. Looks like I discovered a bug in how repeated mathematical operations are handled differently between the two settings!

### Help me with mine!

Well, you've read this far, and while the above material is sort of helpful, it doesn't give you the exact answer you're seeking. Yet, unless you're trying to find solutions for this exact version of the four fours, I think I've been clear enough that you'll have to work within the rules for your specific version of this "puzzle". And the links above, unless they're all broken, should give you some resources. Sorry, but I can't do your homework (or your kid's homework) for you. Figuring out just the answers above took more time than I'd like to admit, but at least there may be some computer programs out there that can do most of the work for you now.

## Legal

Texas Instruments is a trademark of Texas Instruments, Inc.. No infringement of their trademarks or copyrights is intended by the author of this document.

Microsoft, Windows and QBASIC are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

This document ("Four Fours FAQ") is copyright © 1997–2005 by the author (Peter Karsanow), who releases it for personal non-commercial use at no charge. If you duplicate or distribute this document, attribution must always be included, and modifications must be communicated to the author.

Counter says: hits on this page since initialization.

By Peter Karsanow.

The Home page has overall site and copyright information.