Add the four basic operators × ÷ + −: 10 9 8 7 6 5 4 3 2 1 to get the total 2018. Keep the order; do not combine numbers. Don't use any brackets. Use all four operators at least once.
-
$\begingroup$ "do not add [...] numbers" Surely you mean "concatenate", not "adding" (using the + symbol) $\endgroup$ – Lolgast Jan 11 '18 at 14:40
-
$\begingroup$ Sorry for my bad English, it must be clear now, right? $\endgroup$ – Jack Jan 11 '18 at 14:45
-
1$\begingroup$ Yeah, that's better. $\endgroup$ – Lolgast Jan 11 '18 at 14:46
-
$\begingroup$ I think your intent is clear enough, but "do not combine numbers" prohibits the use of multiplication, addition, etc. @Lolgast's suggestion to use the word concatenate is much better. $\endgroup$ – Lawrence Jan 12 '18 at 9:39
I wrote a Python script and made sure these are the only solutions:
$10*9*8*7/6/5*4*3+2*1 = 2018$
$10*9*8*7/6/5*4*3+2/1 = 2018$
Here's the Python code I wrote to solve this puzzle:
#!/usr/bin/python3 o=["+","-","*","/"] op=[0]*9 def con(): n = "" for i in range(10, 0, -1): n = n + str(i) + (str(o[op[10-i]]) if i > 1 else "") return n def f(n): if n == 9: s = con() if eval(s) == 2018: print(s + " = " + str(eval(s))) else: for i in range(4): op[n] = i f(n+1) f(0)
-
$\begingroup$ That's good. What's rationale on like these problems? $\endgroup$ – Jack Jan 11 '18 at 14:51
-
-
-
$\begingroup$ @iBug I doubt hiding the code is necessary - it does not immediately show any solutions, at most the way you could arrive at them, but it would also take a bit of effort understanding it. If people want to do that, they wouldn't really mind a spoiler block either. Also, you should be able to put code in there using regular spoiler blocks and the pre and /pre tags at the start and end. $\endgroup$ – Lolgast Jan 11 '18 at 14:56
-
1$\begingroup$ If these answers are the only two that exist, then there are no solutions for 2018 because you haven't used the minus symbol at least once, failing the "Use all four operators at least once" criterion. $\endgroup$ – John Kossa Jan 12 '18 at 23:38
To answer Bachrach44's comment on iBug's answer, here are all the solutions my script has found so far for the years 2000 onward:
10*9*8*7/6/5*4*3-2-1=2013 10*9*8*7/6/5*4*3-2*1=2014 10*9*8*7/6/5*4*3-2/1=2014 10*9*8*7/6/5*4*3-2+1=2015 10*9*8*7/6/5*4*3+2-1=2017 10*9*8*7/6/5*4*3+2*1=2018 10*9*8*7/6/5*4*3+2/1=2018 10*9*8*7/6/5*4*3+2+1=2019 10-9+8*7*6*5*4/3-2-1=2238 10-9+8*7*6*5*4/3-2*1=2239 10-9+8*7*6*5*4/3-2/1=2239 10-9+8*7*6*5*4/3-2+1=2240 10-9+8*7*6*5*4/3+2-1=2242 10-9+8*7*6*5*4/3+2*1=2243 10-9+8*7*6*5*4/3+2/1=2243 10-9+8*7*6*5*4/3+2+1=2244 10+9+8*7*6*5*4/3-2-1=2256 10+9+8*7*6*5*4/3-2*1=2257 10+9+8*7*6*5*4/3-2/1=2257 10+9+8*7*6*5*4/3-2+1=2258 10+9+8*7*6*5*4/3+2-1=2260 10+9+8*7*6*5*4/3+2*1=2261 10+9+8*7*6*5*4/3+2/1=2261 10+9+8*7*6*5*4/3+2+1=2262 10*9*8*7*6/5/4*3/2-1=2267 10*9/8*7*6/5*4*3*2-1=2267 10*9*8*7*6/5/4*3/2*1=2268 10*9*8*7*6/5/4*3/2/1=2268 10*9/8*7*6/5*4*3*2*1=2268 10*9/8*7*6/5*4*3*2/1=2268 10*9*8*7*6/5/4*3/2+1=2269 10*9/8*7*6/5*4*3*2+1=2269 10*9+8*7*6*5*4/3-2-1=2327 10*9+8*7*6*5*4/3-2*1=2328 10*9+8*7*6*5*4/3-2/1=2328 10*9+8*7*6*5*4/3-2+1=2329 10*9+8*7*6*5*4/3+2-1=2331 10*9+8*7*6*5*4/3+2*1=2332 10*9+8*7*6*5*4/3+2/1=2332 10*9+8*7*6*5*4/3+2+1=2333 10*9/8*7*6*5-4-3/2-1=2356 10*9/8*7*6*5-4-3/2*1=2357 10*9/8*7*6*5-4-3/2/1=2357 10*9/8*7*6*5-4-3/2+1=2358 10*9/8*7*6*5-4+3/2-1=2359 10*9/8*7*6*5-4+3/2*1=2360 10*9/8*7*6*5-4+3/2/1=2360 10*9/8*7*6*5-4+3/2+1=2361 10*9/8*7*6*5+4-3/2-1=2364 10*9/8*7*6*5+4-3/2*1=2365 10*9/8*7*6*5+4-3/2/1=2365 10*9/8*7*6*5+4-3/2+1=2366 10*9/8*7*6*5+4+3/2-1=2367 10*9/8*7*6*5+4+3/2*1=2368 10*9/8*7*6*5+4+3/2/1=2368 10*9/8*7*6*5+4+3/2+1=2369 10-9*8+7*6*5*4*3-2-1=2455 10-9*8+7*6*5*4*3-2*1=2456 10-9*8+7*6*5*4*3-2/1=2456 10-9*8+7*6*5*4*3-2+1=2457 10-9*8+7*6*5*4*3+2-1=2459 10-9*8+7*6*5*4*3+2*1=2460 10-9*8+7*6*5*4*3+2/1=2460 10-9*8+7*6*5*4*3+2+1=2461 10-9-8+7*6*5*4*3-2-1=2510 10-9-8+7*6*5*4*3-2*1=2511 10-9-8+7*6*5*4*3-2/1=2511 10-9-8+7*6*5*4*3-2+1=2512 10-9-8+7*6*5*4*3+2-1=2514 10-9-8+7*6*5*4*3+2*1=2515 10-9-8+7*6*5*4*3+2/1=2515 10-9-8+7*6*5*4*3+2+1=2516 10-9+8*7*6*5/4*3*2-1=2520 10-9+8*7*6*5/4*3*2*1=2521 10-9+8*7*6*5/4*3*2/1=2521 10-9+8*7*6*5/4*3*2+1=2522 10-9+8+7*6*5*4*3-2-1=2526 10-9+8+7*6*5*4*3-2*1=2527 10-9+8+7*6*5*4*3-2/1=2527 10+9-8+7*6*5*4*3-2-1=2528 10-9+8+7*6*5*4*3-2+1=2528 10+9-8+7*6*5*4*3-2*1=2529 10+9-8+7*6*5*4*3-2/1=2529 10+9*8*7*6*5/4/3*2-1=2529 10+9*8*7/6*5*4*3/2-1=2529 10+9-8+7*6*5*4*3-2+1=2530 10+9*8*7*6*5/4/3*2*1=2530 10+9*8*7*6*5/4/3*2/1=2530 10+9*8*7/6*5*4*3/2*1=2530 10+9*8*7/6*5*4*3/2/1=2530 10-9+8+7*6*5*4*3+2-1=2530 10+9*8*7*6*5/4/3*2+1=2531 10+9*8*7/6*5*4*3/2+1=2531 10-9+8+7*6*5*4*3+2*1=2531 10-9+8+7*6*5*4*3+2/1=2531 10+9-8+7*6*5*4*3+2-1=2532 10-9+8+7*6*5*4*3+2+1=2532 10+9-8+7*6*5*4*3+2*1=2533 10+9-8+7*6*5*4*3+2/1=2533 10+9-8+7*6*5*4*3+2+1=2534 10+9+8*7*6*5/4*3*2-1=2538 10+9+8*7*6*5/4*3*2*1=2539 10+9+8*7*6*5/4*3*2/1=2539 10+9+8*7*6*5/4*3*2+1=2540 10+9+8+7*6*5*4*3-2-1=2544 10+9+8+7*6*5*4*3-2*1=2545 10+9+8+7*6*5*4*3-2/1=2545 10+9+8+7*6*5*4*3-2+1=2546 10+9+8+7*6*5*4*3+2-1=2548 10+9+8+7*6*5*4*3+2*1=2549 10+9+8+7*6*5*4*3+2/1=2549 10+9+8+7*6*5*4*3+2+1=2550 10+9*8+7*6*5*4*3-2-1=2599 10*9-8+7*6*5*4*3-2-1=2599 10+9*8+7*6*5*4*3-2*1=2600 10+9*8+7*6*5*4*3-2/1=2600 10*9-8+7*6*5*4*3-2*1=2600 10*9-8+7*6*5*4*3-2/1=2600 10+9*8+7*6*5*4*3-2+1=2601 10*9-8+7*6*5*4*3-2+1=2601 10+9*8+7*6*5*4*3+2-1=2603 10*9-8+7*6*5*4*3+2-1=2603 10+9*8+7*6*5*4*3+2*1=2604 10+9*8+7*6*5*4*3+2/1=2604 10*9-8+7*6*5*4*3+2*1=2604 10*9-8+7*6*5*4*3+2/1=2604 10+9*8+7*6*5*4*3+2+1=2605 10*9-8+7*6*5*4*3+2+1=2605 10*9+8*7*6*5/4*3*2-1=2609 10*9+8*7*6*5/4*3*2*1=2610 10*9+8*7*6*5/4*3*2/1=2610 10*9+8*7*6*5/4*3*2+1=2611 10*9+8+7*6*5*4*3-2-1=2615 10*9+8+7*6*5*4*3-2*1=2616 10*9+8+7*6*5*4*3-2/1=2616 10*9+8+7*6*5*4*3-2+1=2617 10*9+8+7*6*5*4*3+2-1=2619 10*9+8+7*6*5*4*3+2*1=2620 10*9+8+7*6*5*4*3+2/1=2620 10*9+8+7*6*5*4*3+2+1=2621
Note that they always come in groups of 3 with the middle one having twice as many possibilities, which makes sense: You'll always end in either -1, *1, /1 or +1, which result in x-1, x, x and x+1, respectively. These are (should be at least) all the solutions up to the year 2710, I guess that'll do for a while. Based on these results, we could get a question like this next year, then not get any for over 2 centuries, and then we should prepare for a truckload of these questions.
The solution is
$10*9*8*7/6/5*4*3+2*1$
-
$\begingroup$ The solution, or A solution? Did you prove it's the only one? (just curious) $\endgroup$ – Florian Bourse Jan 11 '18 at 14:46
-
$\begingroup$ Is there a solution with all four operators using at least once? (I mean using "-") $\endgroup$ – Jack Jan 11 '18 at 14:46
-
$\begingroup$ Since we're not allowed to use brackets, i don't think there is a solution using all four operators. $\endgroup$ – Alix Eisenhardt Jan 11 '18 at 14:51
-
For 2019 it's:
10∗9∗8∗7/6/5∗4∗3+2+1
-
1$\begingroup$ Welcome to Puzzling! This was not what was asked, but maybe you want to post a new question with this as a solution? $\endgroup$ – Glorfindel Jan 6 at 17:58