Design a clock where each number from 1 to 12 is obtained as an arithmetical operation using each digit of 2017 exactly once: for example, 4 could be made as $2\times 7-10$.
-
3$\begingroup$ Oh, I thought it was going to be this clock $\endgroup$– David KDec 14, 2016 at 18:34
-
$\begingroup$ "tick" means checkmark. It took me a while to figure out what it meant because this question is about clocks. $\endgroup$– user58432Apr 14, 2019 at 6:53
9 Answers
With the digits in order:
$$ \begin{align} 1 &= 2 + 0 - 1 ^ 7 \\ 2 &= 2 + 0 \times 1 \times 7 \\ 3 &= 2 + 0 + 1 ^ 7 \\ 4 &= -2 - 0 - 1 + 7 \\ 5 &= 2 \times (0 - 1) + 7 \\ 6 &= 2 \times 0 - 1 + 7\\ 7 &= 2 \times 0 \times 1 + 7 \\ 8 &= 2 \times 0 + 1 + 7 \\ 9 &= 2 + 0 \times 1 + 7 \\ 10 &= 2 + 0 + 1 + 7 \\ 11 &= 2 + 0! + 1 + 7 \\ 12 &= 2 \times (0 - 1 + 7) \\ \end{align} $$
I tried to make a digital clock.
$0 = (7 + 1 + 2) \times 0$
$1 = (2 + 7 + 1) ^ 0$
$2 = (7 + 1) \times 0 + 2$
$3 = 7 \times 0 + 2 + 1$
$4 = 2 \times 7 - 10$
$5 = 7 - 2 + 1 \times 0$
$6 = 7 - 1 + 2 \times 0$
$7 = 7 + 1 * 2 \times 0$
$8 = 7 + 1 + 0 \times 2$
$9 = 7 + 2 + 1 \times 0$
$10 = 1 + 2 + 7 + 0$
$11 = 12 - 7^0$
$12 = 12 + 7 \times 0$
$13 = 12 + 7 ^ 0$
$14 = 7 \times 2 + 1 \times 0$
$15 = 7 \times 2 + 1 + 0$
$16 = (7 + 1) \times 2 + 0$
$17 = (7 + 1) \times 2 + 0!$
$18 = (7 + 2) \times (1 + 0!)$
$19 = 10 + 2 + 7$
$20 = 17 + 2 + 0!$
$21 = 7 \times (2 + 1 + 0)$
$22 = 7 \times (2 + 1) + 0!$
$23 = 17 + (2 + 0!)!$ or $(7-2-1)! - 0!$ thanks to stack reader
$24 = 2 \times 7 + 10$
[Edit]
What the hell...lets do it for minutes also (I cheated a bit):
$25 = (7 - 1 - 0!)^2$
$26 = 27 - 1 + 0$
$27 = 27 + 1 \times 0$
$28 = 27 + 1 + 0$
$29 = 27 + 1 + 0!$
$30 = 10 \times \lfloor\frac{7}{2}\rfloor$
$31 = \lceil\log(17!) \times 2\rceil + 0!$ // $\log(17!) = 14.5510$
$32 = (1+0!)^{(7-2)}$
$33 = 17 \times 2 - 0!$
$34 = 17 \times 2 + 0$
$35 = 17 \times 2 + 0!$
$36 = \frac{70}{2} + 1$
$37 = \lfloor\ln {7}^{20}\rfloor - 1$ // $\ln {7}^{20} = (38.9182)$
$38 = \lfloor\ln {7}^{20}\rfloor \times 1$ // $\ln {7}^{20} = (38.9182)$
$39 = \lfloor\ln {7}^{20}\rfloor + 1$ // $\ln {7}^{20} = (38.9182)$
$40 = 10 \times \lceil\frac{7}{2}\rceil$
$41 = \lceil\ln {7}^{21}\rceil + 0 $ // $\ln {7}^{21} = (40.8641)$
$42 = \lfloor\ln {72}^{10}\rfloor$ // $\ln {72}^{10} = (42.76666)$
$43 = \lceil\ln {72}^{10}\rceil$ // $\ln {72}^{10} = (42.76666)$
$44 = \lceil{(\ln 710})^{2}\rceil$ // $({\ln 710})^{2} = (43.1027)$
$45 = \lfloor\log(10!) * 7 - \ln(2)\rfloor $ // $\log(10!) = 6.5597$
$46 = \lceil\log(10!) * 7 - \ln(2)\rceil $ // $\log(10!) = 6.5597$
$47 = 7^2 - 1 - 0!$
$48 = 7^2 - 1 + 0$
$49 = 7^2 + 1 \times 0$
$50 = 7^2 + 1 + 0$
$51 = 7^2 + 1 + 0!$
$52 = \lceil\log(2^{170})\rceil$ // $\log(2^{170}) = (51.1750)$
$53 = \lfloor\ln(17!)\rfloor + 20$ // $\ln(17!) = 33.5050$
$54 = 27 \times (1 + 0!)$
$55 = \lceil\ln(27!)\rceil - 10$ // $\ln(27!) = 64.5575$
$56 = \lfloor\ln(17^{20})\rfloor $ // $\ln(17^{20}) = 56.6642 $
$57 = \lceil\ln(17^{20})\rceil $ // $\ln(17^{20}) = 56.6642 $
$58 = 70 - 12 $
$59 = 7^2 + 10$
-
$\begingroup$ @oleslaw....there was no need for 24, because I got 0, but thanks. :) $\endgroup$– MariusDec 13, 2016 at 9:18
-
6
-
$\begingroup$ @stackreader. Thanks. I found an other one in the meantime. $\endgroup$– MariusDec 13, 2016 at 9:19
-
$\begingroup$ @Marius Oh, you're right. You can delete it or leave it as you want :P $\endgroup$– oleslawDec 13, 2016 at 9:20
-
1
$1 = 7 \times 0 + 2 - 1$
$2 = 7 \times 0 + 2 \times 1$
$3 = 20 - 17$
$4 = 7 - 2 - 1 - 0$
$5 = 7 - 2 - 0 \times 1$
$6 = 7 - 1 - 0 \times 2$
$7 = 0 \times 1 \times 2 + 7$
$8 = 0 \times 2 + 1 + 7$
$9 = 0 \times 1 + 2 + 7$
$10 = 0 + 1 + 2 + 7$
$11 = 12 - 7 ^ 0$
$12 = 0 \times 7 + 12$
I'm assuming I'm not allowed to use ^, so give me a few minutes to find an acceptable solution for 11!
-
-
$\begingroup$ @TheGreatEscaper I believe there is no solution for 11 using only the +, -, * and / operators (checked with brute-force computer program) $\endgroup$– oleslawDec 13, 2016 at 9:10
-
$\begingroup$ @oleslaw I'd figured just about that much. Especially when you realise the 0 is basically useless for 11. $\endgroup$ Dec 13, 2016 at 9:31
$1 = 2*0*7+1$
$2 = 2+0*1*7$
$3 = 2+0*7+1$
$4 = (7+1+0)/2$
$5 = -2+0*1+7$
$6 = -2+0+1+7$
$7 = 2*0*1+7$
$8 = 2*0+1+7$
$9 = 2+0*1+7$
$10 = 2+0+1+7$
$11 = 12-7^0$
$12 = 12-7*0$
1=2*7*0+1
2=1*0*7+2
3=7*0+(2+1)
4=2*7-10
5=1*0+(7-2)
6=2*0+(7-1)
7=2*0*1+7
8=2*0+(7+1)
9=1*0+(7+2)
10=0+7+2+1
11=12-7^0
12=0*7+12
A couple more for $12$:
$12=20-1-7, 12=(2+0)\times(-1+7)$
Just for entertainment value, if we limit ourselves with just 4 basic operations (+-*/) without even unary minus, and if we agree to use four separate digits 2,0,1,7 without combining them into numbers like 12, we still can get 11 results out of 12!
Here is the C# code:
var found = new Tuple<int[],Tuple<Func<Decimal, Decimal, Decimal>,string>[]>[12];
var number = new[] { 2, 0, 1, 7 };
var op = new Tuple<Func<Decimal, Decimal, Decimal>, string>[]
{
new Tuple<Func<Decimal, Decimal, Decimal>, string>((x,y) => x + y,"+"),
new Tuple<Func<Decimal, Decimal, Decimal>, string>((x,y) => x - y,"-"),
new Tuple<Func<Decimal, Decimal, Decimal>, string>((x,y) => x * y,"*"),
new Tuple<Func<Decimal, Decimal, Decimal>, string>((x,y) => x / y,"/"),
};
foreach (var i in GetPermutations(number, 4))
{
foreach (var j in GetPermutationsWithRept(op, 3))
{
var ii = i.ToArray(); var jj = j.ToArray();
decimal result = ii[0]; var divideByZero = false;
for (int k = 0;k < 3; k++)
{
if (jj[k] == op[3] && ii[k + 1] == 0)
{
divideByZero = true;
break;
}
result = jj[k].Item1(result,ii[k+1]);
}
if (divideByZero) continue;
if (result <= 12 && result >=1 && result == ((decimal)(int)result))
{
found[(int)result-1] = new Tuple<int[],Tuple<Func<Decimal, Decimal, Decimal>,string>[]>(ii,jj);
}
}
}
PrintResult(found);
And here is the result:
1=(((7*0)-1)+2)
2=(((7/1)*0)+2)
3=(((7-1)-0)/2)
4=(((7-1)-0)-2)
5=(((7/1)-0)-2)
6=(((7+1)-0)-2)
7=(((1*0)/2)+7)
8=(((7-1)-0)+2)
9=(((7/1)-0)+2)
10=(((7+1)-0)+2)
11=Unknown
12=(((7-1)-0)*2)
Implementation of GetPermutations
, GetPermutationsWithRept
and PrintResult
is left as an exercise for the reader.
Anyone would like to write up a code-golf challenge for finding the clock faces ;)?
-
$\begingroup$ As a side note the dreadful
Tuple
s look much nicer in C# 7. $\endgroup$ Dec 14, 2016 at 8:25
1 = 1 + 0 * 2 * 7
2 = 2 + 0 * 1 * 7
3 = 1 + 2 + 0 * 7
4 = 7 - (0 + 1 + 2)
5 = 7 - 2 + 0 * 1
6 = 7 - 1 + 0 * 2
7 = 7 + 0 * 1 * 2
8 = 7 + 1 + 0 * 2
9 = 7 + 2 + 0 * 1
10 = 7 + 0 + 1 + 2
11 = 71 % 20
12 = 12 + 0 * 7
, where % is a modulus operator.
-
-
2$\begingroup$ @Marius Why are all the other numbers afraid of 7? Because 7 8 9 (eight is a homophone of ate). So 7 must be bold. Or it could be that Bhaskar highlighted the numbers which contribute to the final number, so 0 * 2 * 7 does not. $\endgroup$ Dec 13, 2016 at 19:14
-
-
1$\begingroup$ @Marius : As Andrew and wilson say, I highlighted the non-zero terms that contribute to the final results. I thought it would help in reading it quicker. Nvm if it didnt. :) $\endgroup$– BhaskarDec 14, 2016 at 9:25
$1 = 1 ^ {720}$
$2 = 2^0 + 1^7 $
$3 = 2^1 + 7^0$
$4 = 7 - 2 - 1 - 0$
$5 = 7 - 2^1 + 0$
$6 = (2 + 1)! + (7 × 0)$
$7 = 7 + ((2 + 1) × 0)$
$8 = 2 + 0 - 1 + 7$
$9 = 7 + 2 + (1 × 0)$
$10 = 2 + 0 + 1 + 7$
$11 = 2 + 0! + 1 + 7$
$12 = (7 + (2 + 1)!) - 0! $