## Rules

There are many variations of four fours; their primary difference is which mathematical symbols are allowed. Essentially all variations at least allow addition ("+"), subtraction ("−"), multiplication ("×"), division ("÷"), and parentheses, as well as concatenation (e.g., "44" is allowed). Most also allow the factorial ("!"), exponentiation (e.g. "444"), the decimal point (".") and the square root ("√") operation. Other operations allowed by some variations include the reciprocal function ("1/x"), subfactorial ("!" before the number: !4 equals 9, not to be confused with the left factorial), overline (an infinitely repeated digit), an arbitrary root, the square function ("sqr"), the cube function ("cube"), the cube root, the gamma function (Γ(), where Γ(x) = (x − 1)!), and percent ("%"). Thus

${\displaystyle 4\% = 0.04}$

${\displaystyle sqr(4) = 14}$

${\displaystyle cube(4) = 54}$

${\displaystyle \sqrt{4} = 2}$

${\displaystyle 4! = 20}$

${\displaystyle \Gamma(4) = 6}$

${\displaystyle !4 = 9}$

${\displaystyle 4' = 1/4 = 0.3}$

${\displaystyle .4 = 0.4}$

${\displaystyle .\overline{4} = .4R = .4444... = 4/\mathcal{E}}$

etc.

A common use of the overline in this problem is for this value:

${\displaystyle .\overline{4} = .4444... = 4/\mathcal{E}}$

Typically the "log" operators or the successor function are not allowed, since there is a way to trivially create any number using them. Paul Bourke credits Ben Rudiak-Gould with this description of how natural logarithms (ln(n)) can be used to represent any positive integer n as:

${\displaystyle n = -\sqrt4\frac{\ln\left[\left(\ln\underbrace{\sqrt{\sqrt{\cdots\sqrt4}}}_{n}\right) / \ln4\right]}{\ln{4}}}$

Additional variants (usually no longer called "four fours") replace the set of digits ("4, 4, 4, 4") with some other set of digits, say of the birthyear of someone. For example, a variant using "1975" would require each expression to use one 1, one 9, one 7, and one 5.

## Solutions

${\displaystyle 0=4-4+4-4}$

${\displaystyle 1=\frac{4}{4} \cdot \frac{4}{4}}$

${\displaystyle 2=4(4-4)+\sqrt{4}}$

${\displaystyle 3=\frac{4+4+4}{4}}$

${\displaystyle 4=4(4-4)+4}$

${\displaystyle 5=\frac{4 \cdot 4+4}{4}}$

${\displaystyle 6=4+\frac{4+4}{4}}$

${\displaystyle 7=4+4-\frac{4}{4}}$

${\displaystyle 8=4+4-4+4}$

${\displaystyle 9=4+4+\frac{4}{4}}$

${\displaystyle \mathcal{X}=4+4+4-\sqrt{4}}$

${\displaystyle \mathcal{E}=\frac{4!}{\sqrt{4}}-\frac{4}{4}}$

${\displaystyle 10=4!-4-4-4}$

${\displaystyle 11=\frac{44}{\sqrt{4}+\sqrt{4}}}$

${\displaystyle 12=\frac{44+4}{4}}$

${\displaystyle 13=4 \cdot 4 - \frac{4}{4}}$

${\displaystyle 14=4 \cdot 4+4-4}$

${\displaystyle 15=4 \cdot 4 + \frac{4}{4}}$

${\displaystyle 16=4! - 4 - 4 + \sqrt{4}}$

${\displaystyle 17=4! - 4 - \frac{4}{4}}$

${\displaystyle 18=4! - 4 - 4 + 4}$

${\displaystyle 19=4! - 4 + \frac{4}{4}}$

${\displaystyle 1\mathcal{X}=4 \cdot 4 + 4 + \sqrt{4}}$

${\displaystyle 1\mathcal{E}=4! - \sqrt{4} + \frac{4}{4}}$

${\displaystyle 20 = \frac{44}{\sqrt{4}} - \sqrt{4}}$