# Writing numbers puzzle

How do you write 23 using only the number 2?
34 using only the number 3?
56 using only the number 5?
100 using only the number 9?

You can use only the numbers said, but any math you want in order to get the wanted result

You are allowed to use:

• Fractions
• only one number instance + math allowed? So you can't write 1 using 2 like 2/2, because there will be two 2's? Jun 7, 2014 at 12:19
• @klm123 you can use the number any times you want, like greg did in his answer Jun 7, 2014 at 12:46
• You need to define which mathematical operations are allowed. Jun 7, 2014 at 23:02
• @gilles any kind of mathematical operation is allowed Jun 8, 2014 at 9:48
• @Shevliaskovic Again: which mathematical operations are allowed? As it stands, this is a valid answer: “let a be the constant 23, b the constant 34, c the constant 56 and d the constant 100. I write: a; b; c; d. Total number of uses of the digits: 0.” The mathematical operations a, b, c and d are not very common, but they're perfectly cromulent mathematical operations. If you allow “any kind of mathematical operations”, this question is trivial and boring. If you mean that, be more explicit in your question. If you don't mean that, be more explicit in your question. Jun 8, 2014 at 10:50

Greg m's answer is correct, but I'll attempt to do it using as few occurrences of the number as possible.

We can see that for each of your numbers, using $NN + \frac NN$ (where $NN$ refers to stringing two of the digits together) leads to the desired number (e.g. $22 + \frac 22 = 23$, $33 + \frac 33 = 34$, etc.).

However, if we don't allow the stringing of digits together, then the solutions become a little harder to come up with.

For $23$, we have $(2 + 2)! - \frac 22$, which also uses four instances of $2$.

For $34$, we have $3! \times 3! - \frac {3!}3$, which also uses four instances of $3$.

For $56$, we have $5 \times (5 + 5) + 5 + \frac 55$, which uses six instances of $5$.

For $100$, we have $(9 + \frac99)^{\frac{\sqrt{9}!}{\sqrt{9}}}$, which uses five instances of $9$.

(Thanks to greg m for all the improvements.)

You might be able to improve on these, but those are what I see for the moment.

• 3 cubed + 3! + 3/3 Jun 7, 2014 at 13:32
• (9+9/9) to the power of ((root 9)! / (root 9)) Jun 7, 2014 at 13:40
• If it is allowed to use "standard" functions like sin(x), log(x,y) you can use less occurrences of 2 to write 23. If you want you can think about it. Jun 7, 2014 at 15:17
• @klm123 I know what you're talking about, and generally log, floor, and ceil are forbidden for the reasons you're most likely thinking of.
– user88
Jun 7, 2014 at 23:49
• 3! x 3! - 3!/3 yeah i was even iffy about square root, saw log (root 9) 9 as a way of getting 2, but hadn't talked myself into allowing it before i saw the factorial method. i guess it's up to OP but he didn't answer Jun 8, 2014 at 0:42

Trivially, I can write any integer using only the number N as follows:

1 = N/N

2 = N/N + N/N

3 = N/N + N/N + N/N

... and so on.

If you only want one occurrence of the number N, then you're going to have to define "math". Otherwise I'll choose a math with an operator that multiplies by 11 and then adds 1. :)

• This is pretty much what I had in mind. Just one more thing, that I'm not sure about. When you can only use 9, you can say $99 +\frac{9}{9}$, but I'm not sure how correct that is. Jun 7, 2014 at 12:48
• Technically, the $99$ isn't right Jun 7, 2014 at 12:50
• Generally for digit arithmetic puzzles like this one, stringing digits together (e.g. $99$) is allowed.
– user88
Jun 7, 2014 at 13:02
• Then you should probably say "using only the digit 2" rather than "only the number 2". Jun 7, 2014 at 13:23

As the question is currently written, there is a trivial answer. While this answer is boring in terms of algebra, it demonstrates the need for careful wording when writing mathematical reasoning. I expect that this is not what is meant, but it's what is written.

any math you want

clarified in a comment to

any kind of mathematical operation is allowed

The function that takes no argument and always returns 23 is a mathematical operation. It isn't a common one, but it is one. You can define a notation for it if you want — let's call it $\mathrm{Bob}$ — but mathematical operations exist independently of notation. (There's a standard notation for it, which is $23$, but I don't want to risk any confusion with the use of the digit $2$). Here is the number 23 written with 0 uses of the number 2: $\mathrm{Bob}$. All other numbers can be written in this way.

It is typical in this kind of puzzles to restrict to a few operations. A typical set of allowed operations might be:

• the binary operators on numbers addition, subtraction, multiplication, division, exponentiation;
• the unary operators square root and factorial;
• integers written in base 10 using allowed digits, typically also decimal numbers, sometimes including repeated decimals.

Using this set of operations as an example, I think that $23 = 22 + 2/2$ uses the fewest occurrences of the digits (a common goal in such puzzles — but not mentioned in the present question — is to minimize the number of digits that are used). Any integer $n$ can be written as a sum of $n$ occurrences of $2/2$.

For 23, we have

$(2 + 2)! - (2 - 2)!$

For 34, we have

$(3! + 3!)/.3 - 3!$

For 56, we have

$5! \times .5 - 5 + 5/5$ or

$5! \times .5 - 5 + (5 - 5)!$

For 100, we have

$9/.9 \times 9/.9$

222   222      333   3  3     5555   555      9   99   99
2     2        3  3  3     5     5        99  9  9 9  9
22   222      333   3333     555   5555      9  9  9 9  9
2        2        3     3        5  5  5      9  9  9 9  9
2222  222   ,  333      3  ,  555    55   ,  999  99   99


23=2/2+2*2*2*2+2+2+2 34=3/3+3*3*3+3 56=5/5+5*5+5*5 .....This pattern will repeat, basiacly all the numbers are 1 above a number which is divisible by the smaller number, Example: 56=55+1, mod(55, 5)=0

Multiplication is basiacly repeated addition, so i don't count that as cheating since you can easily replace it with repeated addition, but i'm lazy.... don't judge.