How can I get the numbers from (0-30) by using the number $2$ four times.Use any common mathematical function and the (+,-,*,/,^) I tried to solve this puzzle, but I couldn't solve it completely. Some of my results were: $$2/2-2/2=0$$ $$(2*2)/(2*2)=1$$ $$2/2+2/2=2$$ $$2^2-2/2=3$$ $$\frac{2*2}{2}+2=4$$ $$2^2+2/2=5$$ $$2^2*2-2=6$$ $$\frac{2^{2*2}}{2}=8$$ $$(2+2/2)^2=9$$ $$2*2*2+2=10$$ $$2*2*2*2=16$$ $$22+2/2=23$$ $$(2+2)!+2/2=25$$ $$(2+2)!+2+2=28$$
12 Answers
$14=2^{2^2}-2$
and
$18=2^{2^2}+2$
$13=\frac{22}2+2$
$24=\frac{(2^2)!}{\frac22}$
$20=\sqrt{{22}^2}-2=(2^2)!-2^2$
$22=\sqrt{\left[(2^2)!-2\right]^2}$
- 856
-
-
-
-
Is it fair to call 22 two two's? Its one twenty-two. I think the asker wants to use the value 2 four times. Not just the digit 2 four times. Or am I wrong about this? – CogitoErgoCogitoSum Nov 22 '14 at 22:18
-
@Cogito I interpreted the question to allow 22 as two different counts of the digit 2, that's the only possible way I've found to get 13 and 20 – teadawg1337 Nov 22 '14 at 22:37
Though I suspect this may be pushing common functions..
$2^2 + 2 + \Gamma(2) = 7$
$22/{\sqrt{2}^2} = 11$
$\int_{2/2}^{22}dx =21$
$\int_{2-2}^{22}dx =22$
$(2+2)! + \sqrt{2+2} = 26$
- 2,453
-
May be pushing common functions? Gee whiz, what would give you that impression. The gamma function is just so common place. I dont think I can conceive of anything any more fundamental. – CogitoErgoCogitoSum Nov 22 '14 at 22:24
-
@CogitoErgoCogitoSum I take it that sarcasm flew over your head :) – Mike Miller Nov 22 '14 at 22:25
-
Or, perhaps something like $$\Gamma^{-1}((\Gamma^{-1}(2!))!)=4$$ if we're using the $\Gamma$ function and factorials, we can get any number since $\Gamma^{-1}(n!)=n+1$. (I'm not making a joke of an otherwise serious answer, am I?) – Milo Brandt Nov 22 '14 at 22:35
-
@Meelo I wasn't being serious, I was just using it as a cheeky 1! I think there's only one serious suggestion there for 26 as the integrals should really be $1dx$ – Mike Miller Nov 22 '14 at 22:41
-
1@Mike Don't worry, I was being sarcastic when I suggested that you might be being serious. – Milo Brandt Nov 22 '14 at 22:41
The following is a complete list of the rationals obtainable by the five binary operations you gave, from a list of four twos. There are numerous expressions for many of the results and several invalid expressions (like $(2-2)^{2-2}$), but only the first valid expression my program found is shown below. $$\begin{array}{ll} -4194302 & 2-2^{22} \\ -482 & 2-22^2 \\ -220 & 2-222 \\ -42 & 2-2\cdot 22 \\ -40 & 2\cdot (2-22) \\ -22 & 2-(2+22) \\ -21 & \frac{2}{2}-22 \\ -18 & (2+2)-22 \\ -14 & 2-(2+2)^2 \\ -10 & \frac{2-22}{2} \\ -9 & 2-\frac{22}{2} \\ -6 & 2-(2+2) 2 \\ -4 & 2-((2+2)+2) \\ -3 & \frac{2}{2}-(2+2) \\ -2 & 2\cdot (2-2)-2 \\ -\frac{21}{11} & \frac{2}{22}-2 \\ -\frac{3}{2} & \frac{2}{2+2}-2 \\ -1 & \frac{1}{2} (2-(2+2)) \\ -\frac{1}{2} & \frac{1}{2} \left(\frac{2}{2}-2\right) \\ -\frac{1}{10} & \frac{2}{2-22} \\ 0 & (2+2)-(2+2) \\ \frac{1}{2097152} & \frac{2}{2^{22}} \\ \frac{1}{1048576} & 2^{2-22} \\ \frac{1}{242} & \frac{2}{22^2} \\ \frac{1}{121} & \left(\frac{2}{22}\right)^2 \\ \frac{1}{111} & \frac{2}{222} \\ \frac{1}{22} & \frac{2}{2\ 22} \\ \frac{1}{12} & \frac{2}{2+22} \\ \frac{1}{10} & \frac{2}{22-2} \\ \frac{1}{8} & \frac{2}{(2+2)^2} \\ \frac{2}{11} & \frac{2+2}{22} \\ \frac{1}{4} & \frac{2}{2\cdot (2+2)} \\ \frac{1}{3} & \frac{2}{(2+2)+2} \\ \frac{1}{2} & \frac{2^{2-2}}{2} \\ \frac{2}{3} & \frac{2}{\frac{2}{2}+2} \\ 1 & \frac{2+2}{2+2} \\ \frac{3}{2} & 2-\frac{2}{2+2} \\ \frac{21}{11} & 2-\frac{2}{22} \\ 2 & 2\cdot (2-2)+2 \\ \frac{23}{11} & 2+\frac{2}{22} \\ \frac{5}{2} & \frac{2}{2+2}+2 \\ 3 & \frac{1}{2} ((2+2)+2) \\ 4 & ((2+2)+2)-2 \\ 5 & (2+2)+\frac{2}{2} \\ \frac{11}{2} & \frac{22}{2+2} \\ 6 & (2+2) 2-2 \\ 8 & ((2+2)+2)+2 \\ 9 & \left(\frac{2}{2}+2\right)^2 \\ 10 & 2\cdot (2+2)+2 \\ 12 & 2\cdot ((2+2)+2)\\ 13 & 2+\frac{22}{2} \\ 14 & (2+2)^2-2 \\ 16 & (2+2) (2+2) \\ 18 & (2+2)^2+2 \\ 21 & 22-\frac{2}{2} \\ 22 & (2-2)+22 \\ 23 & \frac{2}{2}+22 \\ 26 & (2+2)+22 \\ 32 & 2\cdot (2+2)^2 \\ 36 & ((2+2)+2)^2 \\ 40 & 2\cdot (22-2) \\ 42 & 2\cdot 22-2 \\ 44 & 22+22 \\ 46 & 2+2\cdot 22 \\ 48 & 2 (2+22) \\ 64 & (2\cdot (2+2))^2 \\ 88 & (2+2)\cdot 22 \\ 111 & \frac{222}{2} \\ 121 & \left(\frac{22}{2}\right)^2 \\ 220 & 222-2 \\ 224 & 222+2 \\ 242 & \frac{22^2}{2} \\ 256 & (2+2)^{2+2} \\ 400 & (2-22)^2 \\ 444 & 222\cdot 2 \\ 482 & 22^2-2 \\ 484 & 22\cdot 22 \\ 486 & 2+22^2 \\ 576 & (2+22)^2 \\ 968 & 2\cdot 22^2 \\ 1936 & (2\cdot 22)^2 \\ 2048 & 2^{22/2} \\ 2222 & 2222 \\ 49284 & 222^2 \\ 65536 & 2^{(2+2)^2} \\ 234256 & 22^{2+2} \\ 1048576 & 2^{22-2} \\ 2097152 & \frac{2^{22}}{2} \\ 4194302 & 2^{22}-2 \\ 4194306 & 2+2^{22} \\ 8388608 & 2\cdot 2^{22} \\ 16777216 & 2^{2+22} \\ \textit{big number} & (2+2)^{22} \\ \textit{big number} & 22^{22} \\ \textit{big number} & 2^{222} \\ \textit{big number} & 2^{22^2} \\ \textit{huge number} & 2^{2^{22}} \end{array}$$ You can also get $\sqrt[11]{2}=2^{2/22}$ and $\sqrt{2}=2^{\frac{2}{2+2}}$. No other reals can be made.
The Mathematica code used to generate it basically "contracted" pairs out of a list by applying a binary operation to the pair until the list was a singleton. Adding a factorial would be easy to modify the code to do, but the list would no longer be finite. (You could also add negation similarly, and if you're clever, you can even keep the list finite). It also wouldn't be too hard to make it output LaTeX
Children[x_, ops_] := Join @@ Table[ Table[{Join[x[[1]][[1 ;; i - 1]], {o[x[[1, i]], x[[1, i + 1]]]}, x[[1]][[i + 2 ;; Length[x[[1]]]]]], Join[x[[2]][[1 ;; i - 1]], {{o, x[[2, i]], x[[2, i + 1]]}}, x[[2]][[i + 2 ;; Length[x[[1]]]]]]}, {i, 1, Length[x[[1]]] - 1}], {o, ops}]; CombineStuff[t_, ops_] := DeleteDuplicates[Join @@ (Children[#, ops] & /@ t)]; DrawForm[f_] := If[NumberQ[f], ToString[f], StringJoin["(", DrawForm[f[[2]]], f[[1]], DrawForm[f[[3]]], ")"]]; vals = {#[[1, 1, 1]], Last /@ #} & /@ Gather[Nest[ Function[t, CombineStuff[ t, {#1 + #2 &, #1 - #2 &, #1*#2 &, #1/#2 &, #1^#2 &}]], {{{2, 2, 2, 2}, {2, 2, 2, 2}}}, 3], #1[[1]] == #2[[1]] &]; Sort[{#[[1]], DrawForm[#[[2, 1, 1]]]} & /@ (vals /. Thread[{#1 + #2 &, #1 - #2 &, #1*#2 &, #1/#2 &, #1^#2 &} -> {"+", "-", "*", "/", "^"}])]
I used a similar program to "solve" the game where you look at a clock and figure out what expressions can be made of it. Admittedly, this answer very much resembles "solving" a puzzle by taking out the answer key.
(P.S. Is there a way to include such a table without slowing the program that turns LaTeX into beauty? Or to post code in a nicer form? Sorry if you have a slow computer. Please feel free to edit this to make it less bad)
- 60,888
-
Don't forget that we can also use $22$ instead of two separate $2$s. – user132181 Nov 22 '14 at 22:47
-
1I upgraded the code (though not posted; I just iterated from ${{2,2,22},{2,2,22}}$ for instance) to handle that. (I also made it output nice formatting this time - apologies that it thinks $(2+2)^22$ is a normal order to write multiplication in, but it's readable. – Milo Brandt Nov 22 '14 at 22:57
-
I don't think your program is complete. For example you can obtain -16 from (2+2)(-2-2) – Klik Nov 23 '14 at 08:03
I'm pretty sure that $7$ is impossible. In fact, $11,13,15,17,19$ and every number from $20$ to $30$ is imposssible, too.
$A=$Possible results with two twos: $0,1,4$
$B=$New possible results with three twos: $3,6,8,16$
$C=$New results of an operation with a two and an element of $B$: $5,9,10,12,14,18,32,36,64,256$
Operating two elements of $A$ gives nothing new.
- 65,084
-
-
1
-
This is elegant (moreso than my solution of having a computer try every expression), but I think it lacks the proper justification; $B$ should include elements like $-2$ and $\frac{1}2$ - and unless you can prove that those won't create new results, then I don't think this suffices. Also, I'm not sure that only considering "new results" can suffice since I'm not sure "can be represented by $2$ twos" is a subset of "can be represented by $3$ twos". (You also missed $65536=2^{2^{2^2}}$ – Milo Brandt Nov 22 '14 at 23:12
Are you allowed $.\dot 2=\frac 29$? That opens up a host of possibilities - for example $2+2+\sqrt {\cfrac 2{.\dot 2}}=7$
- 100,194
-
-
-
-
@EEE Short for "that's a shame" because there would be some creative things to be explored. I put it in an answer because other people looking at very similar problems might be working with different rules. – Mark Bennet Nov 22 '14 at 23:39
$$7=\left\lfloor e^2 \right\rfloor+2(2-2)=2.2.2-\lg2$$ $$11=\left \lceil e^2 \right \rceil +2+2/2=\frac{22}{2}\lg2$$ $$17=2^{2^2}+\lg2$$
- 1,720
A slightly more creative way for 12 and 17:
$|2+2\sqrt{-2}|^2 = 12$
$|(2+2)!+\sqrt{-2}|/{\sqrt{2}} = 17$
- 2,453
We don't seem to have 15 yet:
${2\cdot 2 + 2 \choose 2} = 15$
If we're going to use $\Gamma$ and the like, we can get $30$ too:
$2 \cdot {\Gamma(2+2) \choose 2} = 30$
No $19$ or $27$ or $29$ yet either (though this keeps getting more absurd):
$\lfloor{2+\sqrt{2}}\rfloor^{\lfloor{2+\sqrt{2}}\rfloor} = 27$
$\lfloor \mathrm{Exp}(2)\rfloor \cdot \lfloor{2 + \sqrt{2}}\rfloor - 2 = 19$
$\lfloor \mathrm{Exp}(2)\rfloor \cdot (2 + 2) + \lfloor{\sqrt{2}}\rfloor = 29$
I think every number has appeared once now (some rather more questionably than others).
- 7,653
$$ \log_{\sqrt{\sqrt{\sqrt{2}}}}(2) - 2/2 = 8 - 1 = 7$$
- 33,239
- 1
-
This problem can be generalized by below. 2-log2(log2(√√√⋅⋅⋅⋅√2) = 2+n (n is the number of times the route repeats.) – Tets Nov 14 '18 at 23:55
big-listtag as I don't think it's reasonable for only one person to give 24 solutions. – beep-boop Nov 22 '14 at 20:44