29

Add the four basic operators $\times\div+\,\;-$ and optionally brackets to:

$10 \quad 9 \quad 8 \quad 7 \quad 6 \quad 5 \quad 4 \quad 3 \quad 2 \quad 1$

To get the total $2016$.

Rules:

  • We are looking for the simplest solution - i.e. the least amount of characters (ignoring spaces). Please include your character count in your answer.
  • Keep the order; do not add or combine numbers.
  • Use all four operators at least once.

Credit for initial concept: Alex Bellos

GentlePurpleRain
  • 25,965
  • 6
  • 93
  • 155
rybo111
  • 4,945
  • 3
  • 25
  • 51
  • 4
    Is it one of each operator? And can you combine numbers (eg. 2 and 1 makes 21)? – JonTheMon Jan 04 '16 at 17:34
  • 2
    If there are multiple ways of doing this, do you want the most complex, the most simple, or some other criteria? – Aggie Kidd Jan 04 '16 at 17:38
  • 3
    Do the numbers need to be in that order in the equation? – JonTheMon Jan 04 '16 at 17:58
  • 1
    Fun fact, if Carat was allowed: 10 x 9 + 8 + 7 * 6 + 5 ^ 4 x 3 + 2 -1 (credit: @TheDanWoods Twitter) – rybo111 Jan 05 '16 at 00:20
  • It's possible only if there's a zero available. Otherwise, you can get 2013, 2014, 2015, 2017, 2018 and 2019, or 1008 and 4032. No 2016. – nicael Jan 05 '16 at 08:33
  • 20160 is also possible. – nicael Jan 05 '16 at 09:02
  • 1
    @rybo111 there are actually 2 ways with a single carat: 10 x 9 + 8 + 7 x 6 + 5 ^ 4 x 3 + 2 - 1 10 x 9 + 8 x 7 - 6 + 5 ^ 4 x 3 + 2 - 1

    edit: oops 2 not 5 - foiled by integer division!

    – ejrb Jan 05 '16 at 15:40
  • So, if this gets polished and nailed down (looks like most of that is already done), are we going to make it an annual puzzle? – Iszi Jan 05 '16 at 18:41
  • @Iszi I'm happy for the community to fine-tune the challenge for the years ahead as it wasn't my idea to begin with. But perhaps each year could have different limitations to keep it fresh. – rybo111 Jan 05 '16 at 18:48
  • Is it possible to have an average computer find the optimal solution in reasonable time? – Evorlor Jan 06 '16 at 04:15
  • @Evorlor There's no solution. I've checked it with javascript. – nicael Jan 06 '16 at 13:30
  • Is it kosher to edit a puzzle around here after someone answers it? – Yakk Jan 07 '16 at 15:34
  • @Yakk sounds like a question for Meta. What edit are you referring to? – rybo111 Jan 07 '16 at 15:58
  • @rybo111 http://puzzling.stackexchange.com/a/25041/11838 answer predated your first edit, and you edited your puzzle then told that person to change their answer. There may be other answers that predate the puzzle rule change. – Yakk Jan 07 '16 at 16:34
  • @Yakk When the question was first posted, there were a number of questions which needed clarification. It wouldn't have been kosher to leave the question as it was. – rybo111 Jan 07 '16 at 20:25

13 Answers13

24

22 characters

$10 \times 9 \times 8 \times 7 \times 6 \div 5 \div (4 - 3 + 2) \times 1$

I looked at @Will's answer and found a way to improve on it.

GentlePurpleRain
  • 25,965
  • 6
  • 93
  • 155
Joel Rondeau
  • 7,540
  • 1
  • 30
  • 44
  • Ah, that's nice one - good job! – Will Jan 04 '16 at 18:44
  • This is great! Is it possible without brackets? – rybo111 Jan 04 '16 at 18:49
  • 2
    @rybo111 - Brute force turns up no solutions without groupings using only +, -, , and /. Closest two are: `10987/6/543-2+1 = 2015.0and10987/6/54*3+2-1 = 2017.0`. This should be accepted. :) – Will Jan 04 '16 at 19:31
  • 11
    @Will keep that second one saved for next year! – Joel Rondeau Jan 04 '16 at 19:32
  • 1
    Couldn't this save one character? Seems to me the final operator is unnecessary. – Jordan Jan 04 '16 at 19:43
  • @Jordan how do you mean? – rybo111 Jan 04 '16 at 19:52
  • 1
    @rybo111 brackets are an implicit multiplication. The answer is exactly the same if the final * is removed, but with one less character. – Jordan Jan 04 '16 at 19:54
  • @Jordan Sorry, can you explain what you mean by removing the final *? That would leave ...2) 1. – rybo111 Jan 04 '16 at 21:11
  • @rybo111 Yes, that is the implicit multiplication Jordan is referring to. – nanofarad Jan 04 '16 at 23:14
  • @hexafraction I thought so, but it doesn't work on Google so assumed I was doing something wrong – rybo111 Jan 05 '16 at 00:22
  • 3
    @rybo111 There is plenty of different mathematical notation that is accepted by mathematical professionals that doesn't work on Google, for various reasons (ranging from the fact that it can't be written as plain text, to that Google simply doesn't implement it). – nanofarad Jan 05 '16 at 00:39
18

22 characters

I don't think you can beat Joel's answer at 22 characters, but there are some nice ways to tie it (including a variation of Joel's for completeness):

$(10 - 9 + 8 \times 7 \times 6 - 5 + 4) \times 3 \times 2 \times 1$
$10 - 9 + 8 \times 7 \times (6 \times 5 + 4 \times 3 \div 2) - 1$
$10 - 9 + 8 \times 7 \times (6 + 5 \times 4 \times 3 \div 2) - 1$
$10 - 9 + 8 \times 7 \times 6 \div (5 - 4) \times 3 \times 2 - 1$
$10 - 9 + 8 \times 7 \times 6 \times (5 + 4) \div 3 \times 2 - 1$
$10 - 9 + 8 \times 7 \times 6 \times (5 + 4 + 3) \div 2 - 1$
$10 + (9 \times 8 \times 7 - 6 + 5) \times 4 - 3 \times 2 \div 1$
$10 \times 9 \times 8 \times 7 \div (6 - 5 + 4 - 3 \div 2 - 1)$
$10 \times 9 \times 8 \times 7 \div (6 \times 5 \div 4 - 3 \times 2 + 1)$
$10 \times 9 \times 8 \times 7 \times 6 \div (5 \times 4 - 3 \times 2 + 1)$
$10 \times 9 \times 8 \times 7 \times 6 \div (5 + 4 \times 3 - 2 \times 1)$
$10 \times 9 \times 8 \times 7 \times 6 \div 5 \div (4 - 3 + 2) \times 1$

There are other ways but many of them are trivial (change $\div 1$ to $\times 1$ or vice-versa, or $\div 1)$ to $)\div 1$

If we didn't have the restriction that we need to use all the different operators there is also a very nice solution:

$ 10 \times 9 \times 8 \times 7 \times 6 \div (5 + 4 + 3 + 2 + 1)$

GentlePurpleRain
  • 25,965
  • 6
  • 93
  • 155
Paul
  • 1,035
  • 6
  • 9
  • 3
    The non-restriction version is so clean! – rybo111 Jan 05 '16 at 00:09
  • 2
    @rybo111 Yeah, I like how the / is right in the middle. – Paul Jan 05 '16 at 01:04
  • 4
    You found so many ways. Is there any generalized method to come with these? or just random guesses? – Mahesha999 Jan 05 '16 at 13:42
  • 22 characters is indeed the best possible solution as it cannot be done without parentheses (verified by exhaustive search) – ejrb Jan 05 '16 at 16:22
  • I don't understand why nobody is taking the hints in multiple comments. You can take many of these to 21 characters by simply removing any multiplication operators next to a parentheses. – Jordan Jan 06 '16 at 16:11
  • @Mahesha999 You can generate every expression in postfix notation without needing parenthesis. I just generated a bunch of valid postfix expressions with the numerals in decreasing order and then checked if they evaluated to 2016 and if they did I converted them to infix. I don't think I did an exhaustive search though. – Paul May 05 '16 at 18:50
12

I came up with:

$(10 - 9) \times 8 \times 7 \times 6 \times (5 - 4 + 3 + 2 \div 1)$

This is 9 operators and 2 required groupings, for a total of 24 characters.

GentlePurpleRain
  • 25,965
  • 6
  • 93
  • 155
Will
  • 13,917
  • 3
  • 58
  • 89
8

$10 + 9 \times 8 - 7 + 654 \times 3 - 21$

17 Characters... Is mushing numbers together allowed? Also, yay Mathematica.

GentlePurpleRain
  • 25,965
  • 6
  • 93
  • 155
6

If we allow for implicit multiplication of parenthesized expressions then the following solutions, all of length 20, become possible

$10\times 9\times 8\times 7(6\div 5-4+3) 2\times 1$
$10\times 9\times 8\times 7 (6\div 5-4+3) 2\div 1$
$10\times 9\times 8 (7-6\div 5-4+3-2) 1$

This list has been generated via exhaustive search, and excludes needlessly parenthesizing expressions that only contain multiplication or division.

SamYonnou
  • 1,490
  • 1
  • 10
  • 8
3

21 chars

$10 \times 9 \times 8 (7 - 6 \div 5 - 4 + 3 - 2 \times 1)$

GentlePurpleRain
  • 25,965
  • 6
  • 93
  • 155
Jamie Barker
  • 1,515
  • 8
  • 15
1

22 Chars:

10 x 9 x 8 x 7 x 6/(5 + 4 + 3 + 2 + 1)

1

24 chars:

$(10-9+8) \times 7 \times (6 \times 5 + 4-3 + 2-1)$

$9 \times 7 \times 32 = 2016$

GentlePurpleRain
  • 25,965
  • 6
  • 93
  • 155
hans-t
  • 111
  • 2
1

Here is one more with 22 characters not mentioned in @PaulPro's answer:

10*9*8*7*6/(5*4-3-2*1)

Edit: As @DanHenderson pointed out, this has no + operator.

wythagoras
  • 4,133
  • 17
  • 54
1

22 chars

±10*9*8*7*6/(5+4+3+2+1)

If ± is valid as usage of - character, then you get two answers, which of one is correct :)

Viktor Mellgren
  • 793
  • 5
  • 12
0

22 20 characters

10 + 9 * 8 * 7 * 4 - 6 / 3 - 5 - 2 - 1

Without order :(

rybo111
  • 4,945
  • 3
  • 25
  • 51
Revadike
  • 135
  • 2
0

21!

10*9*8*7*6/(5+4+3+2+1)

But not valid, I guess...

AeJey
  • 14,506
  • 5
  • 58
  • 117
Rahul
  • 11
0

27 characters (missing /):

(10-9)(8*7)(6-5)(4)(3)(2+1)

and 22 characters (missing -):

10*9*8*7*6/(5+4+3+2+1)

rybo111
  • 4,945
  • 3
  • 25
  • 51
undo
  • 101
  • 2