Four Fours

Rules

Choose a number. Use **4**, **4**, **4**, and **4**, with any operators and parentheses, to equal your chosen number. For example:

**0** = `(4 + 4) – (4 + 4)`

**1** = `(4 + 4) / (4 + 4)`

You can use:

- add
`+`

- subtract
`–`

- multiply
`*`

- divide
`/`

*x*raised to the power*n*,*x*^{n}, shown as`x^n`

, where you make*x*and*n*using the other rules- parentheses
`()`

Use rules for 0 to 20, and:

- factorial
`!`

, like`4!`

for**24** - square root, like
`sqrt(4)`

for**2** `.4~`

for**0.444…**

You cannot use:

`%`

, like`44%`

for**0.44**`.(`

*anything*`)`

, like`.(4!)`

for**0.24**`1`

directly, like**4**or^{-1}`1/4`

for**0.25**- functions like
`int()`

,`ceil()`

,`floor()`

,`frac()`

, as these are approximations `log`

, which you could use to find every solution by nesting`log`

and`sqrt`

- constants other than
`4`

, like`π`

, or*e*

- Solutions contributed by the Web community.
- Go beyond 100 as a programming challenge.

Site Copyright © 2024 John Valentine, All rights reserved. Mastodon.