# How to get 5 from 0,0,0 and 1?

Can you use the digits 0,0,0 and 1 each only once in a mathematical expression for the number 5 using only common mathematical symbols with at least 1 mathematical symbol between each number?

Let's go with

$(1!+0!+0!)!-0!=5$

• Good answer, but I think you can use just (1) instead of 1 factorial (1!) – Sherlock Holmes May 28 '17 at 10:35
• Parallelism or whatever the word it is. – bleh May 28 '17 at 19:56
• @SherlockHolmes Wouldn't look as pretty, though – Rob May 29 '17 at 5:30
• @bleh Vectorization – Aiman Al-Eryani May 29 '17 at 10:27
• @AimanAl-Eryani No, it is parrallelism – Wen1now May 29 '17 at 11:02

First off, latest edit - just for fun, how to get 5 from just 0 and 1:

$$\left\lceil\sqrt{\left\lceil\sqrt{\frac{0!}{.1}}\right\rceil!}\right\rceil$$

Before rule change posted:

$$\frac{10}{0! + 0!}$$

With the changed rules:

$$\frac{\frac{0!}{.1}}{0! + 0!}$$

And while we're at it, here's $0$ to $28$:

$$0 \cdot 0 \cdot 0 \cdot 1 = 0$$
$$0 \cdot 0 \cdot 0 + 1 = 1$$
$$0 \cdot 0 + 0! + 1 = 2$$
$$0 + 0! + 0! + 1 = 3$$
$$0! + 0! + 0! + 1 = 4$$
$$\frac{\frac{0!}{.1}}{0! + 0!} = 5$$
$$1\cdot(0! + 0! + 0!)! = 6$$
$$1 + (0! + 0! + 0!)! = 7$$
$$\frac{0!}{.1} - 0! - 0! = 8$$
$$\frac{0!}{.1} - 0! \cdot 0! = 9$$
$$\frac{0! \cdot 0! \cdot 0!}{.1} = 10$$
$$\frac{0!}{.1} + 0! \cdot 0! = 11$$
$$\frac{0!}{.1} + 0! + 0! = 12$$
$$\left\lfloor\frac{\sqrt{0! + 0!}}{.1}\right\rfloor - 0! =13$$
$$\left\lfloor\frac{\sqrt{0! + 0!}}{.1}\right\rfloor \cdot 0! =14$$
$$\left\lfloor\frac{\sqrt{0! + 0!}}{.1}\right\rfloor + 0! =15$$
$$\left\lceil\sqrt{\frac{0!}{.1}}\right\rceil ^ {0! + 0!} = 16$$
$$\left\lfloor\frac{\sqrt{0! + 0! +0!}}{.1}\right\rfloor = 17$$
$$\left\lceil\frac{\sqrt{0! + 0! +0!}}{.1}\right\rceil = 18$$
$$\frac{0! + 0!}{.1} - 0! = 19$$
$$\frac{0! + 0!}{.1} \cdot 0! = 20$$
$$\frac{0! + 0!}{.1} + 0! = 21$$
$$\left\lceil\sqrt{\frac{0!}{.1}}\right\rceil! - 0! - 0! = 22$$
$$\left\lceil\sqrt{\frac{0!}{.1}}\right\rceil! - 0! \cdot 0! = 23$$
$$(1 + 0! + 0! + 0!)! = 24$$
$$\left\lceil\sqrt{\frac{0!}{.1}}\right\rceil! + 0! \cdot 0! = 25$$
$$\left\lceil\sqrt{(((0! + 0! + 0!)!)!}\right\rceil - 0! = 26$$
$$\left\lceil\sqrt{(((0! + 0! + 0!)!)!}\right\rceil \cdot 0! = 27$$
$$\left\lceil\sqrt{(((0! + 0! + 0!)!)!}\right\rceil + 0! = 28$$

And here's how to get 5 from just 0, 0 and 1:

$$\left\lceil\sqrt{\frac{0!}{.1}}\right\rceil + 0!$$

And how to get 5 from just 0, 0 and 0:

$$\left\lfloor\sqrt{\sqrt{((0! + 0! + 0!)!)!}}\right\rfloor$$

• Sorry, I realised I should have changed my edit earlier. Your answer works for my original question, but can you do the new one? – Y. Zhang May 28 '17 at 9:59
• This program just prints a hardcoded equation! Why using a program? just write it by hand. A nice program would output the equation given the desired output and the allowed terms and operators. – Sembei Norimaki May 30 '17 at 8:59
• @SembeiNorimaki fixed it for you :) – Paul Evans May 30 '17 at 13:15
• make sure you are taking the factorials one by one, otherwise you could imply the double factorial. :) – Quintec Jun 2 '17 at 23:51
• @thecoder16 thanks - edited accordingly :) – Paul Evans Jun 2 '17 at 23:55

A simple variation with factorials:

$$(0!+0!+0!)!-1 = 5$$

• While this is, arguably, aesthetically prettier,  it is only a trivial variation on the accepted answer. – Peregrine Rook May 29 '17 at 17:48
• While it is, arguably, only a trivial variation on the accepted answer, it is aesthetically prettier. – Florian F May 29 '17 at 19:44

Just for fun

${\Big\lceil} \sqrt{(0! + 0! + 0! + 1!)!} \> \Big\rceil$

or

${\Huge\lfloor} \sqrt{\sqrt{\sqrt{\sqrt{\sqrt{((0!+0!+0!+1!)!)!}}}}}{\Huge\rfloor}$

As a derivative

$\frac {d}{dx}[((0!+0!+0!)!)-1]x$

If the question was changed to require NO mathematical symbols, then using Base 5, we could write

0010 = (0*5^3 + 0*5^2 +1*5^1 +0*5^0)

In fact we could write any positive integer n using base n as 0010!

• Well representing n as 10 (base n) is kinda trivially cheating... works for any positive integer n... but you still have to construct the '5' from somewhere. – smci May 30 '17 at 7:25
• @smci I don't see how my comment about base 5 is "cheating," since it doesn't even answer the question (which specified there must be mathematical symbols between each digit). I highlighted this with a capital "NO" in my post. If anything its off topic. However, the fact that it works for any n certainly does not make it cheating. Now, if you want to argue that converting 0010 to base to requires a 5 to multiply the 1, I agree. However as a representation of 5 in base 5 I see no problem. – Evan Rosica Jun 2 '17 at 23:32
• @smci Unless you want to argue that denoting it as base 5 requires a 5, in which case I reply that all answers must denote base 10, and thus are incorrect since they use too many 1s and 0s..... – Evan Rosica Jun 2 '17 at 23:35
• Evan, ok I see the second part is an offtopic sidenote; you might make it say so more clearly. I wasn't attacking you, sir. Just noting that modification makes all these digit-arithmetic-manipulation genre questions utterly moot... As to whether we can understand '10' to be implicit in our (human-biased) decimal representation, yes. There has to be some default. I suppose we can argue that base-2 would be most universal species-independent choice, also allows for most efficient encoding (if our muscles allow us to have arbitrary adjacent fingers up and down...) – smci Jun 4 '17 at 20:43