# How can I write the numbers 5 and 7 as some sequence of operations on three 9s?

I want to make the numbers $1, 2, ..., 9$ using exactly three copies of the number $9$ and the following actions: addition, subtraction, multiplication, division, squaring, taking square roots, and other action.

How can we make the numbers $5$ or $7$?

For example, we can make the below numbers using exactly three copies of the number 9.

• $1=\dfrac{\sqrt 9\times\sqrt9}{9}$
• $2=\dfrac{9+9}{9}$
• $3=\dfrac{\sqrt9\times9}{9}$
• $4=\dfrac{9}{9}+\sqrt9$
• $5=\,?$
• $6=\dfrac{9+9}{\sqrt9}$
• $7=\,?$
• $8=9-\dfrac{9}{9}$
• $9=9+9-9.$

Now, how can we make the numbers 5 and 7?

• Can you be specific about "and other action"? Apr 25 '14 at 11:06
• Maybe by using the other action except Sum, Subtraction, multiplication, division, Square, root . Apr 25 '14 at 11:11
• @elham You need to be careful when you say "other action". Is factorial allowed(provided in one answer)? Is logarithm allowed(provided in another answer). What if I define a function $f$, such that $f(9) = 5/3$ and use $f(9) + f(9) + f(9)$? Apr 25 '14 at 12:57
• Umm 3+2 and 4+3? You could uses the representation of the other numbers to add up to 5 and 7 respectively. In fact, just having a representation of 1 would also be enough. Repeated addition gets you others. Cumbersome? Sure. Solves the problem? Yes :)
– PhD
Apr 25 '14 at 19:42
• @PhD Note "using exactly three copies of the number 9." The question may be ill-defined in other respects, but it's at least clear in that regard. Apr 25 '14 at 20:28

$$5=\sqrt{9}! - \frac{9}{9}, \quad 7=\sqrt{9}! + \frac{9}{9}$$

• fuglede and Lucian: Thank you for your answer. Do we can make number 5 or 7 by only using of the actions Sum, Subtraction, multiplication, division, Square or root?(similar numbers 1,2,3,4,6,8,9) Apr 25 '14 at 13:49
• @elham See the comments on jingyu9575 answer Apr 25 '14 at 19:01

Since the question did not say the number of actions must be finite,

$${\sqrt{\sqrt{\sqrt{...\sqrt9}}}}=1$$

Then $5=1+1+3$, $7=1+3+3$.

• I love you for this. Apr 25 '14 at 18:34
• The question did say to use exactly three instances of the number 9, though. Apr 25 '14 at 18:53
• $\sqrt{\dots \sqrt{9}}+\sqrt{\dots \sqrt{9}}+\sqrt{9}=5$ Apr 25 '14 at 18:58
• $\sqrt{\dots \sqrt{9}}+\sqrt{9}+\sqrt{9}=7$ Apr 25 '14 at 18:58
• @Awesome Here $\sqrt{...\sqrt9}=1$ represents ${\lim \limits_{n \to \infty}}\sqrt[2^n]{9}=1$, and if you take ceil, it becomes $\lceil{\lim \limits_{n \to \infty}}\sqrt[2^n]{9}\rceil=\lceil1\rceil=1$. You can't silently change $\lceil{\lim \limits_{n \to \infty}}\sqrt[2^n]{9}\rceil$ to ${\lim \limits_{n \to \infty}}\lceil\sqrt[2^n]{9}\rceil$. Apr 26 '14 at 5:26

$$5=\log_{\sqrt9}9+\sqrt9,\qquad7=9-\log_{\sqrt9}9.$$

Just do a handstand and read:$$\frac{9}{9}\mp9$$

• excellent!! :-) Apr 25 '14 at 19:29
• alt+ctrl+down arrow for the lazy ones. Apr 26 '14 at 4:20
• Not everybody is using Windows... (and probably even needs a specific version of it) Apr 26 '14 at 19:22
• For the dense like me, the handstand part is extremely important. Apr 27 '14 at 19:21
• @Rolazaro Azeveires, for the record, it has actually nothing to do with Windows, it is a feature of the Intel graphics adapter software that is usually bundled with Windows computers having a Intel graphics card. Apr 28 '14 at 23:38

A couple in the classic vein for these, both taking stealthy advantage of being base-10: $\displaystyle 5=\frac{9}{.9+.9}$ and $\displaystyle 7=\frac{9}{.9}-\sqrt{9}$.

Do we can make number 5 or 7 by only using of the actions Sum, Subtraction, multiplication, division, Square or root?

No, it is not possible. Assuming that the square root should only be applied once to each term (and not infinitely often, as proposed in another answer), there is no way of representing the numbers 5.0 and 7.0 under the given constaints.

The following is a list of all terms that result in values between 1.0 and 10.0 that can be obtained with addition, subtraction, multiplication, division, squaring or square root, sorted by the actual result. It was computed with a program simiar to the one in this stackoverflow answer, which computes all combinations of terms with the given operations. The list here only contains the equivalence classes referring to the result (that is, there are many ways of obtaining "1.0" as a result, but only one is listed here).

It can be seen that all whole numbers between 1.0 and 10.0 can be obtained, except for 5.0 and 7.0.

EDIT based on the request in the comments: The list now contains only the whole numbers that can be obtained, and, for 5 and 7, the next smaller/larger number, respectively. The full list can be seen in the previous revision

• $(9 \times (9/(9)^2)) = 1$
• $((9+9)/9) = 2$
• $((9+\sqrt{9})-9) = 3$
• $(\sqrt{9}+(9/9)) = 4$
• $\sqrt{(((9)^2-9)/\sqrt{9})} = 4.898979485566356$
• $\sqrt{(((9)^2-\sqrt{9})/\sqrt{9})} = 5.0990195135927845$
• $(9-(9/\sqrt{9})) = 6$
• $((9)^2/(9+\sqrt{9})) = 6.75$
• $((\sqrt{9}-(\sqrt{9}/9)))^2 = 7.111111111111111$
• $(9-(9/9)) = 8$
• $((9+9)-9) = 9$
• $(9+(9/9)) = 10$
• Nice answer, but why are you including the operation of "squaring"?
– 6005
Apr 26 '14 at 22:52
• @Goos "Squaring" was explicitly requested by the asker. I also wondered why it should play such a special role, but presumably, with other exponents (particularly with 0.7324...) it might be too boring. Apr 26 '14 at 23:25
• Aha, carry on then. I had missed that.
– 6005
Apr 26 '14 at 23:27
• Do you think you could place the list of numerical results in a separate document linked in this answer (perhaps a TeX'ed PDF, since you've already prepared your results in TeX)? Having the list here almost doubles the length of the page, which is especially inconvenient for people reading on mobile devices. Apr 27 '14 at 4:29
• @DavidZhang I'll try to do this later today - hopefully, it is possible to upload a PDF as an "image" and link it from here, because I'd like to avoid linking to an external file. Otherwise I'll try to figure out whether it can be placed in some small but scrollable text box or so (I still have to get more familiar with the formatting possibilities here) Apr 27 '14 at 13:08

$5 = \sqrt 9 + \sqrt 9 \ -\ .\bar{9}$

and

$7 = \sqrt 9 + \sqrt 9 \ +\ .\bar{9}$ ?

• I like this one. But it kinda breaks the rule about using only three nines. Apr 25 '14 at 19:48
• You mean $.\bar{9}$? I don't think $.\bar{9}$ has multiple 9s any more than 9! has multiple 8s. Apr 26 '14 at 19:59
• Depends on whether you consider ¯ an operation or a notation. Apr 28 '14 at 8:27

Interestingly, if you allow for natural logarithms and cube roots in your "other action," you can actually express any natural number (including zero) using only three nines. Observe that $$n = -\frac{1}{\ln 9} \ln \left( \frac{\ln \left( \sqrt{\sqrt{\cdots \sqrt{ 9}}}\right)}{\ln 9} \right)$$ where there are $2n$ cube roots applied to the $9$ on the upper-right.

To see why this is true, recall the following logarithm identity: $$\ln a^b = b \ln a.$$ Now, we can simplify:

\begin{align} -\frac{1}{\ln 9} \ln \left( \frac{\ln \left( \sqrt{\sqrt{\cdots \sqrt{ 9}}}\right)}{\ln 9} \right) &= -\frac{1}{\ln 9} \ln \left( \frac{\ln \left( 9^{9^{-n}} \right)}{\ln 9} \right) \\ &= -\frac{1}{\ln 9} \ln \left( \frac{9^{-n} \ln 9}{\ln 9} \right) \\ &= -\frac{1}{\ln 9} \ln 9^{-n} \\[1mm] &= \frac{1}{\ln 9} n \ln 9 \\[2mm] &= n \end{align} You see, all I've done is implicitly introduce a $9^{-n}$ by asking you to take a cube root $2n$ times and cleverly hide it behind a wall of logarithms.

• Hmm "3"s are not allowed, tiny or not... Apr 27 '14 at 7:55
• The OP explicitly states that square roots are allowed, and those carry an implicit 2. That the cube root function contains a small "3" when written is only an artifact of our notation. Apr 27 '14 at 8:25
• Haha I know that.. It's just a joke.. like the question itself.. Apr 27 '14 at 8:26

$$\sqrt{9}+\sqrt{9}\pm \lfloor \sqrt{\sqrt{9}} \rfloor$$

• Why not just ⌊ √(9+9+9) ⌋? To brag for having both answers in one? :) Apr 29 '14 at 9:35
• To extrapolate, I find $$\lfloor \sqrt{ 9 + 9 + 9} \rfloor$$ and $$\sqrt{9} + \lfloor \sqrt{ 9 + 9 } \rfloor$$ somehow more elegant. Nice idea with the floor function though. Apr 29 '14 at 9:38

$5 = \dfrac{\ln(9 \times \sqrt{\sqrt{9}})}{\ln(\sqrt{\sqrt{9}})}$

$7 = \dfrac{\ln\left(\dfrac{9}{\sqrt{\sqrt{\sqrt{9}}}}\right)}{\ln\left(\sqrt{\sqrt{\sqrt{9}}}\right)}$

$5 = \lfloor\sqrt{\sqrt{999}}\rfloor = \lfloor\sqrt{9+9+9}\rfloor$

$7 = \lceil\ln999\rceil = \lfloor\sqrt{9}\sqrt{9}\ln\ln9\rfloor$

It would be much more interesting if the target was a large number like $123456789$. Who can get it with the shortest $\LaTeX$ formula that only has 3 nines and no other digits?

I just came up with one...

7 = 9P$\sqrt 9$ >> ($\sqrt 9$)!

where the >> is the bitwise shift operator (as in programming languages such as C).

9P$\sqrt 9$ is 9P3, or 504.

($\sqrt 9$)! is 3!, or 6.

And this gives 504 >> 6, or 7.

Try $\lceil\sqrt{9!}\rceil$. If you insist on three 9s try $\lfloor\sqrt{9!}\rfloor+0.\bar 9$.

• You were just playing with the calculator, right? Apr 29 '14 at 14:02