3 ms·
An old math teacher of mine gave me this fun little problem: For each number n from 1 to 9, make 6 from three copies of n, using only basic-ish arithmetic and n
by waterhouse 15y ago
An old math teacher of mine gave me this fun little problem: For each number n from 1 to 9, make 6 from three copies of n, using only basic-ish arithmetic and no other numbers. For example, 2+2+2 = 6. I will leave the rest as a puzzle for the reader.
Precise statement of restrictions (enumerating these may give you a bit of a hint): You're allowed to use these operators: + - * / √ !
I did this, and then I figured out that if you're allowed to use the floor function as well, you can fulfill this task for any n ≥ 1. If [x] denotes the floor of x, then I'll demonstrate with 56:
√56 is somewhat less than 8. √√56 is somewhat less than 3. √√√56 is somewhat less than 2. Then [√√√56] = 1. Thus, we can have: ([√√√56]+[√√√56]+[√√√56])! = 3! = 6.
The expression to find "number of times you'll have to take square root of n" is slightly interesting: we want to take k square roots and end up with something less than 2, so n^(1/2^k) < 2, or n < 2^(2^k), so k > log_2(log_2(n)).
- demallien 15y agoWhat was the solution for n = 1?
- larelli 15y ago(1+1+1)! = 3! = 6 as the parent comment suggested.
- deleted 15y ago[deleted]
- chadzawistowski 15y agoOf course, performing more square roots than necessary won't hurt.
- InnocentB 15y agoThat's indeed a fun little problem, thanks! For the lazy, solutions are at http://pastebin.com/XJZTFGHP http://pastebin.com/XJZTFGHP
- waterhouse 15y agoNice. I had some slightly different solutions in mind, which I have added: http://pastebin.com/TeBPHbb6 http://pastebin.com/TeBPHbb6
- ptmx 15y agoYes, I enjoyed that diversion quite a bit. A few different solutions: http://pastebin.com/Mf6ZmhfA http://pastebin.com/Mf6ZmhfA
- Jach 15y agoThis reminds me of Knuth's conjecture. http://www.perlmonks.org/?node_id=443037 http://www.perlmonks.org/?node_id=443037 (Starting with 3, apply some combination of factorial, square root, and floor functions. Knuth conjectured all natural numbers are achievable this way.)