3

The expression is $$ 2\_\,\_\,\_\,\_5=2015 $$ you have to replace 2 of the blanks with digits (0-9), and the other 2 with one of the operations $+- \times \div$. Is it possible to make the expression true?

Mike Pierce
  • 18,938
  • 1
    Yes $,,,,,$ – GPerez Jun 03 '15 at 11:22
  • 3
    @GPerez You should post that as an answer. I wanted to. Just to try and hammer home that you really should take a bit more time to frame and work on the question on your own and post the results if you want a constructive answer. – DRF Jun 03 '15 at 11:25
  • @DRF I was considering it, but then I thought that the comments are the place, if any, for witty half-answers. I wouldn't want to give the impression that people give those kinds of answers here, as actual answers. Anyhow I've voted to close. – GPerez Jun 03 '15 at 11:32
  • 1
    @GPerez Fair enough. "You're a better man then I'm Gunga Din." :) – DRF Jun 03 '15 at 11:34
  • 1
    Is there some trick ? I cannot find a solution ... – Peter Jun 03 '15 at 12:13

2 Answers2

3

Since you need two digits and two operators, the resulting expression would involve one $2$-digit number and two single digit numbers.

Now note that the largest such expression that fits the prompt is $$ 2*9*95 = 1710 < 2015 $$ thus the problem doesn't admit any solution.


In my previous answer, I showed that the only two solutions with one operator and three digits are: $$ 2010 + 5 = 2015 \qquad \text{and} \qquad 2020 - 5 = 2015 $$

A.P.
  • 9,728
1

There are no solutions that solve the prompt as given. I made the below Python script to run through the possibilities without leading zeros. You can then go through the possibilities with leading zeros separately and note that clearly, none of them are solutions.

operations = ['+','-','*','/']
expchars = [0,0,0,0]
solution = "no solutions"
done = False

for c in operations:
    for d in operations:
        for m in range(2):
            for n in range(m+2,4):
                numindex = range(4)
                numindex.remove(m)
                numindex.remove(n)
                for s in range(10):
                    for t in range(10):
                        expchars[m] = c
                        expchars[n] = d
                        expchars[numindex[0]] = str(s)
                        expchars[numindex[1]] = str(t)
                        while not done:
                            done = True
                            exp = "2" + ''.join(expchars) + "5"
                            try:
                                if eval(exp) == 2015:
                                    solution = exp
                            except ZeroDivisionError:
                                #print("divided by zero: " + exp)
                                pass
                            except SyntaxError:
                                done = False
                                #print("leading zero: " + exp)
                                if s == 0:
                                    expchars[numindex[0]] = ' '
                                if t == 0:
                                    expchars[numindex[1]] = ' '


print(solution)
Ben Grossmann
  • 225,327