28

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$.

Mr Pie
  • 6,682
  • 1
  • 25
  • 88
mau
  • 2,095
  • 1
  • 18
  • 37

9 Answers9

52

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} $$

2012rcampion
  • 18,915
  • 3
  • 66
  • 98
48

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$

Marius
  • 18,049
  • 4
  • 54
  • 101
  • @oleslaw....there was no need for 24, because I got 0, but thanks. :) – Marius Dec 13 '16 at 09:18
  • 6
    (7-2-1)! - 0! = 23 – stack reader Dec 13 '16 at 09:19
  • @stackreader. Thanks. I found an other one in the meantime. – Marius Dec 13 '16 at 09:19
  • @Marius Oh, you're right. You can delete it or leave it as you want :P – oleslaw Dec 13 '16 at 09:20
  • Neh...I'l leave it. I've seen screwed up digital clocks in my life :) – Marius Dec 13 '16 at 09:21
  • You could avoid some logarithms and roundings by using binomial coefficients (which you can write using only parentheses). For example 38=binomial(10,2)-7 ; 42=binomial(7,2)*(1+0!) ; 52=binomial(10,2)+7 ; 56=binomial(7+1,2+0!). Some other method would probably be needed to get rid of all of them, though – Leo Dec 13 '16 at 14:37
  • @Leo I can't argue with that, but I'm not doing all the numbers again. – Marius Dec 13 '16 at 14:43
  • 1
    You could do $37 = 20 + 17$ ;-) – ETHproductions Dec 13 '16 at 21:34
  • yeah, I could, but I got in to the rhythm with the math functions that I forgot about the "normal" stuff. Check the edit history to see the last 2 numbers I filled in. Not what you would expect. – Marius Dec 13 '16 at 21:37
11

$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!

2012rcampion
  • 18,915
  • 3
  • 66
  • 98
TheGreatEscaper
  • 11,946
  • 1
  • 42
  • 96
4

$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$

Bugs
  • 103
  • 5
Pokemon
  • 1,689
  • 10
  • 12
3

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

Sid
  • 15,153
  • 2
  • 43
  • 94
3

A couple more for $12$:

$12=20-1-7, 12=(2+0)\times(-1+7)$

JMP
  • 35,612
  • 7
  • 78
  • 151
2

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 ;)?

Andrew Savinykh
  • 597
  • 4
  • 11
0

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.

Bhaskar
  • 101
  • 3
  • why are some digits bold? – Marius Dec 13 '16 at 14:13
  • 2
    @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. – Andrew Morton Dec 13 '16 at 19:14
  • @Marius looks like non-zero terms are bold – wilson Dec 14 '16 at 02:57
  • 1
    @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. :) – Bhaskar Dec 14 '16 at 09:25
0

$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! $