A formula with only one $0$ that evaluates to a given integer

Just found this math puzzle online:

Original puzzle: Using one zero (and no other numbers) and mathematical (including trigonometric and advanced) operations, how can you achieve a final result of 6?

Advanced one: Using only trigonometric functions and a single instance of the number zero, derive a forumula to calculate any positive integer n.

I am sure there is an answer somewhere online but I can't find one - very interesting.

And the answer I can think of for the original one is

$$\lim_{x\to0}\;(a^x+ a^x+ a^x+ a^x+ a^x+ a^x)$$

This may not be the most efficient solution for 6, but it works in general. First, note that $cos(0) = 1$, so we can start with $1$. The important formulas are then

(a) $\tan(\cot^{-1}(x)) = \frac{1}{x}$

(b) $\sin(\cot^{-1}(x)) = \frac{1}{\sqrt{1 + x^2}}$

These can be checked by drawing a triangle with the appropriate sides lengths. Then, starting with $\sqrt{n}$, applying (b) and then (a) gives $\sqrt{n+1}$. Thus, starting with $\sqrt{n} = n = 1$, repeated applications of (a) and (b) can give the square root of any natural number. Since every natural number is the square root of another natural number, we can get any natural number this way.

Edit: After looking at the link Eugene gave below, this same process can be done more simply by iterating

$\sec( \tan^{-1}(x)) = \sqrt{x^2+1}$

• Of course, we can generalise even more - using trigonometry and a single instance of zero can give us any rational number, as seen in USAMO 1995/2. Of course, you can't get a formula for it, but it's still a nice result. – H. M. Šiljak Jun 8 '12 at 21:38
• to obtain a 1, we can also use 0! – mau Mar 27 '13 at 14:21

A completely different (trig free) approach: $$\lceil \exp(\exp(0))\rceil! = \lceil \exp(1)\rceil! = \lceil 2.718281828\ldots\rceil! = 3!=6$$

This is a puzzle from the XKCD wiki (0 = 6 problem). The answer is available in the discussion tab.

• Wow! This "sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan sec arctan (0)" from the article is just awesome – Vrashabh Irde Jun 8 '12 at 7:07

Two solutions:

1. Let $S(n)$ denote the successor operation over the natural numbers, that is $S(n)=n+S(0)$. $$S(S(S(S(S(S(0))))))=6$$

2. Similarly using the cardinality operator, the power set operation $P(x)$, and set difference, we can write:

$$6 = \big|P(P(P(P(\{n\in\mathbb N\mid n<0\})))\setminus P(P(\{n\in\mathbb N\mid n<0\}))\big|$$

Now, why this question generally annoys me? Well, coming from a logic and set theory point of view I am aware that $0$ is merely a syntactic creature. The question asks something about how many ways there are to write a certain constant by a formula.

There is no specification of the language, but it is somewhat implied that the operations should be "mathematical" in their nature. I use quotation because of course one can always define $f$ to be some bizarre permutation of any set containing both $0$ and $6$ and simply write $f(0)=6$.

While the question clearly means "high-school'ish" mathematical operations, it is ill-defined, almost as the questions of the form "Guess the next number in the sequence: $a,b,c,\ldots$" - the mathematical answer is usually $42$.

(0!+0!+0!)!=6

As 0!=1 then it becomes (1+1+1)! => 3! = 6.

• Only one zero is allowed. – Minethlos Sep 8 '15 at 10:05
• @G.Sassatelli: $(x! + x! + x!)! \big| _{x=0}$ would do, no need to delete the answer. – Alex M. Sep 8 '15 at 12:09

protected by user26857Sep 8 '15 at 11:29

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).