# Magical properties in “2015”?

This question is inspired by one particular answer to a riddle for 2015

Here's the answer copied in full below:

$2015+9=2024$

$2024\div 8=253$

$253-7=246$

$246\div 6=41$

$41-5=36$

$36\div 4=9$

$9\div 3=3$

$3-2=1$

$1-1=0$.

Then $2015=(((1+2)\cdot 3\cdot 4+5)\cdot 6+7)\cdot 8-9$

Is this a coincidence that @paw88789 was able to go down the line (9,8,7,...,1) and

a) have the result be 0?

b) all the divisions work without fractions?

Could applying the same sort of technique happen with all numbers or was this particularly special case?

How might a number be identified as being a good fit for this sort of pattern?

• I'd be surprised if there are any interesting mathematical patterns at work here. There is a particular set of numbers which can be obtained by substituting the four arithmetic operators in every possible way into the expression $((((((((1\circ2)\circ3)\circ4)\circ5)\circ6)\circ7\circ)\circ8)\circ9)$. We can go around defining sets of numbers all day, but most of them won't have any interesting internal structure. – Jack M Jan 3 '15 at 0:03

In the spirit of my answer to the original question, here are the results of an exhaustive Mathematica search over all expressions of the form $$(((((((1\circ2)\circ3)\circ4)\circ5)\circ6)\circ7\circ)\circ8)\circ9$$ where $\circ$ is one of $\{+,-,\times,\div\}$. In particular, note that $$2015 = (((1 + 2) \times 3 \times 4 + 5) \times 6 + 7) \times 8 - 9$$ is the unique expression of this form producing $2015$. Indeed, most numbers of this form ($12386$ out of the $21836$ which can be produced, approx. $56.72\%$) have a unique representation, so $2015$ is by no means "special" in this regard. I can confirm that $$544320 = (1+2) \times 3 \times 4 \times 5 \times 6 \times 7 \times 8 \times 9$$ is the largest number that can be produced, and $$-241920 = (1-2-3) \times 4 \times 5 \times 6 \times 7 \times 8 \times 9$$ is the smallest.

0 can be made in 347 ways

9 can be made in 222 ways

-9 can be made in 212 ways

1 can be made in 153 ways

-1 can be made in 146 ways

17 can be made in 106 ways

72 can be made in 97 ways

The following numbers can be made in 95 ways:
-17
6

18 can be made in 93 ways

-72 can be made in 91 ways

3 can be made in 90 ways

8/9 can be made in 89 ways

-6 can be made in 88 ways

-8 can be made in 85 ways

The following numbers can be made in 84 ways:
-8/9
10

8 can be made in 82 ways

-3 can be made in 81 ways

The following numbers can be made in 80 ways:
4
7
36

The following numbers can be made in 79 ways:
5
15

-18 can be made in 78 ways

-5 can be made in 77 ways

The following numbers can be made in 76 ways:
-10
-4
11

The following numbers can be made in 75 ways:
-7
2

25 can be made in 72 ways

24 can be made in 71 ways

12 can be made in 70 ways

45 can be made in 69 ways

The following numbers can be made in 68 ways:
-15
-2

-11 can be made in 64 ways

27 can be made in 63 ways

The following numbers can be made in 62 ways:
1/9
135

13 can be made in 61 ways

The following numbers can be made in 60 ways:
5/3
16

The following numbers can be made in 59 ways:
-24
-12
-1/9

The following numbers can be made in 58 ways:
-25
54

The following numbers can be made in 57 ways:
-36
-27

The following numbers can be made in 54 ways:
-45
-16
19
21

The following numbers can be made in 53 ways:
14
23

The following numbers can be made in 51 ways:
-54
63
81

The following numbers can be made in 50 ways:
-135
-63
-13
-15/2

The following numbers can be made in 49 ways:
-3/2
15/2
144

The following numbers can be made in 48 ways:
-27/4
-5/3
2/3
9/2
63/8

The following numbers can be made in 47 ways:
20
33
90

The following numbers can be made in 45 ways:
-2/3
30
39

The following numbers can be made in 44 ways:
-63/8
3/2
47

The following numbers can be made in 43 ways:
16/9
21/2
27/2
22
31
41
65

The following numbers can be made in 42 ways:
-81
-47
-23
-9/2
4/9

The following numbers can be made in 41 ways:
-144
17/2

The following numbers can be made in 40 ways:
-20
-19
8/3
45/4

The following numbers can be made in 39 ways:
-27/2
-65/8
-1/3
29

The following numbers can be made in 38 ways:
-65
-16/9
-9/8
27/4
45/2
126

The following numbers can be made in 37 ways:
-504
-56/9
7/72
1/6
5/9
9/4
56/9
79/8
108
504

The following numbers can be made in 36 ways:
-21
-14
7/9
7/3
216

The following numbers can be made in 35 ways:
-79/8
-13/2
-11/2
-7/9
-7/72
2/9
1/3
9/8
65/8
19/2
43
180

The following numbers can be made in 34 ways:
-33
-45/2
-19/2
-33/4
4/3
14/9
39/4
63/2

The following numbers can be made in 33 ways:
-39
-29
-15/4
-2/9
1/2
10/9
57
117
189

The following numbers can be made in 32 ways:
-90
-41
-21/2
-35/4
-19/3
-4/3
-1/2
23/3
55
59

The following numbers can be made in 31 ways:
-30
-16/3
-8/3
-4/9
5/2
16/3
37/4

The following numbers can be made in 30 ways:
-99
-17/2
1/4
20/9
11/2
13/2
25/3
25/2
49

The following numbers can be made in 29 ways:
-55
-31
-5/9
1/36
33/2
39/2
99

The following numbers can be made in 28 ways:
-126
13/9
71/8
23/2
34
35
37

The following numbers can be made in 27 ways:
-180
-71/8
-23/3
-20/9
-10/9
-1/7
7/18
8/7
17/3
19/3
33/4
35/4
32/3
81/4
38
48
51
306

The following numbers can be made in 26 ways:
-216
-43
-39/4
-25/3
-7/2
-9/4
-11/9
1/72
1/12
29/4
73/8
75/8
32
60
84
153

The following numbers can be made in 25 ways:
-108
-57
-35
-22
-25/2
-29/3
-73/8
-7/3
-1/36
5/18
6/7
18/7
34/9
40/9
35/3
40
261
324
432

The following numbers can be made in 24 ways:
-32
-37/4
-14/9
-16/21
-5/7
-1/6
-1/18
-1/72
1/18
12/7
29/9
57/4
28
66
73
95
360
450
936

The following numbers can be made in 23 ways:
-33/2
-75/8
-13/3
-15/7
-8/7
1/7
7/12
11/9
9/7
10/3
50/9
85/8
104/9
26
42
52
87
113
243
576

The following numbers can be made in 22 ways:
-324
-66
-34
-39/2
-63/4
-23/2
-69/8
-31/4
-29/4
-41/6
-9/7
5/7
16/21
21/4
64/9
55/6
29/3
117/8
189/4
50
75
198
495
513

The following numbers can be made in 21 ways:
-576
-59
-37
-63/2
-26
-43/4
-59/8
-64/9
23/7
27/8
20/3
69/8
43/4
69
79
114
193

The following numbers can be made in 20 ways:
-495
-306
-153
-117
-73
-51
-48
-27/8
-10/3
-5/2
-22/9
-9/5
-4/7
-5/18
-1/12
13/72
5/6
15/7
32/9
27/7
28/3
63/4
46
61
67
105
162
171
177
234
288

The following numbers can be made in 19 ways:
-243
-198
-75
-60
-81/2
-38
-99/4
-117/8
-81/8
-28/3
-53/6
-20/3
-51/8
-45/8
-34/9
-13/7
-7/6
-5/6
-7/18
-7/36
3/4
4/5
13/7
22/9
35/8
24/5
45/8
81/8
41/4
111/7
113/7
37/2
112/3
53
432/7
70
96
252

The following numbers can be made in 18 ways:
-513
-432
-288
-261
-105
-103
-53
-50
-57/4
-21/4
-29/6
-13/9
-27/28
1/24
7/36
2/7
3/8
10/7
28/9
11/3
13/3
31/6
41/6
61/8
53/6
95/8
99/8
135/8
56
71
207
225
327
345
3024

The following numbers can be made in 17 ways:
-189
-93
-432/7
-52
-28
-113/7
-111/7
-45/4
-32/3
-85/8
-31/3
-32/9
-23/7
-6/7
-1/4
-1/8
-1/24
1/54
3/7
20/21
27/28
7/6
7/2
15/4
59/8
93/8
81/5
69/4
55/3
135/7
103
121
132
150
159
270
405

The following numbers can be made in 16 ways:
-121
-40
-35/3
-104/9
-123/16
-61/8
-14/3
-41/9
-11/3
-29/9
-50/63
-2/7
-13/72
-2/27
2/27
1/8
5/36
50/63
62/63
9/5
19/9
17/7
26/9
43/9
25/4
31/4
76/9
65/7
31/3
67/6
112/9
29/2
56/3
41/2
224/9
51/2
207/8
75/2
44
450/7
85
97
120
215
233
387
1008
2016

63 numbers can be formed in 15 ways

64 numbers can be formed in 14 ways

80 numbers can be formed in 13 ways

109 numbers can be formed in 12 ways

116 numbers can be formed in 11 ways

175 numbers can be formed in 10 ways

215 numbers can be formed in 9 ways

288 numbers can be formed in 8 ways

395 numbers can be formed in 7 ways

509 numbers can be formed in 6 ways

585 numbers can be formed in 5 ways

994 numbers can be formed in 4 ways

1865 numbers can be formed in 3 ways

3477 numbers can be formed in 2 ways

12386 numbers can be formed in 1 way


For next year's reference, here are all $16$ expressions producing $2016$: $$(((((((1\div2)+3)+4)\times5)\times6)+7)-8)\times9$$ $$(((((((1+2)+3)+4)+5)+6)+7)\times8)\times9$$ $$(((((((1\times2)\times3)+4)+5)+6)+7)\times8)\times9$$ $$(((((((1\times2)+3)\times4)-5)+6)+7)\times8)\times9$$ $$(((((((1\times2)-3)+4)\times5)+6)+7)\times8)\times9$$ $$(((((((1+2)+3)\times4)+5)+6)-7)\times8)\times9$$ $$(((((((1\times2)\times3)\times4)+5)+6)-7)\times8)\times9$$ $$(((((((1+2)\times3)\times4)+5)-6)-7)\times8)\times9$$ $$(((((((1-2)\times3)-4)+5)+6)\times7)\times8)\times9$$ $$(((((((1\times2)-3)+4)-5)+6)\times7)\times8)\times9$$ $$(((((((1\div2)-3)\times4)\div5)+6)\times7)\times8)\times9$$ $$(((((((1+2)\div3)+4)+5)-6)\times7)\times8)\times9$$ $$(((((((1+2)\times3)-4)+5)-6)\times7)\times8)\times9$$ $$(((((((1+2)+3)-4)\times5)-6)\times7)\times8)\times9$$ $$(((((((1\times2)\times3)-4)\times5)-6)\times7)\times8)\times9$$ $$(((((((1-2)\div3)-4)+5)\times6)\times7)\times8)\times9$$

• Awesome. I'd give an extra +1 for next year's reference if I could. – emragins Jan 5 '15 at 19:38
• @emragins Then you might be disappointed to know that there are no solutions for 2017-2024; only in 2025 do we start having solutions again, of which there are $9$. – David Zhang Jan 5 '15 at 20:41

As there are 8 places to put an operator and 3 different operators ($+$, $-$, $\cdot$), there is a no more then $3^8=6561$ (some of them will be identical) numbers that can be reached with a calculation of that form, and thus there are less than 6561 numbers for which you can reach $0$. Some are small ($0$ is possibility, some even negative, and the largest is $9! = 362880$) if that makes it a coincidence that the result is $0$, depends on your definition of coincidence.

As for b) the divisions seems to be inserted every time they give an integer result.

• Just a point of interest, I think the largest should actually be $\dfrac{3\times9!}{2}$, because we are better off adding the $1$ than multiplying it. – Peter Woolfitt Jan 3 '15 at 0:03
• @PeterWoolfitt: Right, I often forget that. – Henrik supports the community Jan 3 '15 at 9:37