8
$\begingroup$

This is a puzzle I love to play with my math students and I hope you will enjoy it too:

You are given the numbers 1, 2, 3, 4, and 5 exactly once.

Your target is a number, e.g. 36. Can you create a calculation with addition, subtraction, multiplication, division and parentheses, so that you arrive at this number?

Concatenating the numbers (like 12 out of 1 and 2) is explicitly forbidden.

For this example, the solution would be

$$ 36=(2+4) \cdot (1+5) $$

but remember: You can use each number only once.

Can you find a calculation for all numbers from 1 to 75?

BONUS question: Now powers are allowed! Can you go to 125 now?

$\endgroup$
8
$\begingroup$
1 = 1  
2 = 2  
3 = 3  
4 = 4  
5 = 5  
6 = 5 + 1  
7 = 5 + 2  
8 = 5 + 3  
9 = 5 + 4  
10 = 5 + 4 + 1  
11 = 5 + 4 + 2  
12 = 5 + 4 + 3  
13 = 5 + 4 + 3 + 1  
14 = 5 + 4 + 3 + 2  
15 = 5 + 4 + 3 + 2 + 1  
16 = 4 ⋅ (1 + 3)  
17 = (5 ⋅ 4) - 3  
18 = (5 ⋅ 4) - 2  
19 = (5 ⋅ 4) - 1  
20 = (5 ⋅ 4)  
21 = (5 ⋅ 4) + 1  
22 = (5 ⋅ 4) + 2  
23 = (5 ⋅ 4) + 3  
24 = (5 + 1) ⋅ 4  
25 = ((4 + 5) ⋅ 3) - 2  
26 = ((4 + 5) ⋅ 3) - 1  
27 = ((4 + 5) ⋅ 3)  
28 = ((4 + 5) ⋅ 3) + 1  
29 = ((4 + 5) ⋅ 3) + 2  
30 = 2 ⋅ 3 ⋅ 5  
31 = (2 ⋅ 3 ⋅ 5) + 1  
32 = (1 + 3) ⋅ 4 ⋅ 2  
33 = (2 ⋅ 3 ⋅ 5) + 4 - 1  
34 = (2 ⋅ 3 ⋅ 5) + 4  
35 = (2 ⋅ 3 ⋅ 5) + 4 + 1  
36 = (2 + 4) ⋅ (5 + 1)
37 = ((4 + 3) ⋅ 5) + 2  
38 = ((4 + 3) ⋅ 5) + 2 + 1  
40 = 2 ⋅ 4 ⋅ 5  
41 = (2 ⋅ 4 ⋅ 5) + 1  
42 = (2 ⋅ 4 ⋅ 5) - 1 + 3  
43 = (2 ⋅ 4 ⋅ 5) + 3  
44 = (2 ⋅ 4 ⋅ 5) + 3 + 1  
45 = (2 + 3 + 4) ⋅ 5  
46 = ((2 + 3 + 4) ⋅ 5) + 1  
47 = ((2 + 4) ⋅ (3 + 5)) - 1  
48 = ((2 + 4) ⋅ (3 + 5))  
49 = ((2 + 4) ⋅ (3 + 5)) + 1  
50 = 2 ⋅ 5 ⋅ (4 + 1)  
51 = ((5 ⋅ 4) - 2 - 1) ⋅ 3  
52 = ((5 ⋅ 2) + 3) ⋅ 4  
53 = (((5 ⋅ 2) + 3) ⋅ 4) + 1  
54 = (5 + 4) ⋅ 3 ⋅ 2  
55 = ((5 + 4) ⋅ 3 ⋅ 2) + 1  
56 = (4 + 2 + 1) ⋅ (5 + 3)  
57 = (5 ⋅ 4 ⋅ 3) - 2 - 1  
58 = (5 ⋅ 4 ⋅ 3) - 2  
59 = (5 ⋅ 4 ⋅ 3) - 1  
60 = (5 ⋅ 4 ⋅ 3)  
61 = (5 ⋅ 4 ⋅ 3) + 1  
62 = (5 ⋅ 4 ⋅ 3) + 2  
63 = (5 ⋅ 4 ⋅ 3) + 1 + 2  
64 = (5 + 3) ⋅ 4 ⋅ 2  
65 = ((5 + 3) ⋅ 4 ⋅ 2) + 1  
66 = (5 + 1) ⋅ ((4 ⋅ 2) + 3)  
67 = ((5 ⋅ 3) + 2) ⋅ 4) - 1  
68 = ((5 ⋅ 3) + 2) ⋅ 4)  
69 = ((5 ⋅ 3) + 2) ⋅ 4) + 1  
70 = (3 + 4) ⋅ 5 ⋅ 2  
71 = ((3 + 4) ⋅ 5 ⋅ 2) + 1  
72 = (5 + 1) ⋅ 3 ⋅ 4  
73 = ((4 + 1) ⋅ 3 ⋅ 5) - 2  
74 = ((5 + 1) ⋅ 3 ⋅ 4) + 2  
75 = (4 + 1) ⋅ 3 ⋅ 5

These are all the solutions for the main puzzle, I'm going to give the bonus puzzle a go when I wake up.

$\endgroup$
4
  • $\begingroup$ Awesome :) I hope you had fun while doing that! $\endgroup$
    – Nurator
    Feb 26 at 14:05
  • $\begingroup$ Is there a particular reason why you insist on formatting all the equations as code? They're not code. Plus the scrollbar makes seeing all of them annoying. $\endgroup$
    – bobble
    Feb 27 at 4:33
  • $\begingroup$ I think it looks nicer like this, but if it's some community thing to only format code as code then by all means, change it back. $\endgroup$ Feb 27 at 5:03
  • $\begingroup$ It's not exactly a community thing. It's an accessibility issue. A screen reader will look at your equations and try to read them as programming code. $\endgroup$
    – bobble
    Feb 27 at 5:27
5
$\begingroup$

"a guy" has covered the initial question here is the bonus

$76 = 3^4 - 5$
$77 = 3^4 + 1 - 5$
$78 = 3^4 + 2 - 5$
$79 = 3^4 - 2$
$80 = 3^4 - 1$
$81 = 3^4$
$82 = 3^4 + 1$
$83 = 3^4 + 2$
$84 = 3^4 + 2 + 1$
$85 = 3^4 + 5 - 1$
$86 = 3^4 + 5$
$87 = 3^4 + 5 + 1$
$88 = 3^4 + 5 + 2$
$89 = 3^4 + 5 + 2 + 1$
$90 = 3^4 + (5\times 2) - 1$
$91 = 3^4 + (5\times 2)$
$92 = 3^4 + (5\times 2) + 1$
$93 = 3^4 + ((5+1)\times 2)$
$94 = ((2^4 + 3) \times 5) - 1$
$95 = ((2^4 + 3) \times 5)$
$96 = ((2^4 + 3) \times 5) + 1$
$97 = (2^5 \times 3) + 1$
$98 = (5^2 \times 4) - 3 + 1$
$99 = (5^2 \times 4) - 1$
$100 = (5^2 \times 4)$
$101 = (5^2 \times 4) + 1$
$102 = (5^2 \times 4) + 3 - 1$
$103 = (5^2 \times 4) + 3$
$104 = (5^2 \times 4) + 3 + 1$
$105 = 3 \times 5 \times (1+2+4)$
$106 = 3^4 + 5^2$
$107 = 3^4 + 5^2 + 1$
$108 = (5^2 + 3 - 1) \times 4$
$109 = ((2^5 + 4) \times 3) + 1$
$110 = ((4\times 3) - 1) \times 2 \times 5$
$111 = ((5^2 + 3) \times 4) - 1$
$112 = ((5^2 + 3) \times 4)$
$113 = ((5^2 + 3) \times 4) + 1$
$114 = ((5\times 4)-1) \times 3 \times 2$
$115 = 5^3 - ((4+1)\times 2)$
$116 = 5^3 - (4\times 2) - 1$
$117 = 5^3 - (4\times 2)$
$118 = 5^3 - (4\times 2) + 1$
$119 = 5^3 - 4 - 2$
$120 = 5^3 - 4 - 1$
$121 = 5^3 - 4$
$122 = 5^3 - 2 - 1$
$123 = 5^3 - 2$
$124 = 5^3 - 1$
$125 = 5^3$

We can even go a bit further, without much difficulty

$126 = 5^3 + 1$
$127 = 5^3 + 2$
$128 = 5^3 + 2 + 1$
$129 = 5^3 + 4$
$130 = 5^3 + 4 + 1$
$131 = 5^3 + 4 + 2$
$132 = 5^3 + 4 + 2 + 1$
$133 = 5^3 + (4\times 2)$
$134 = 5^3 + (4\times 2) + 1$
$135 = 5^3 + ((4+1) \times 2)$

Here are a few more

$136 = (2^5 + 3 - 1) \times 4$
$137 = 5^3 + (4 \times (2+1))$
$138 = (4^3 + 5) \times 2$
$139 = ((4^3 + 5) \times 2) + 1$
$140 = (4^3 + 5 + 1) \times 2$
$141 = 5^3 + 2^4$
$142 = 5^3 + 2^4 + 1$
$143 = (3 \times 4)^2 - 1$
$144 = (3 \times 4)^2$
$145 = (3 \times 4)^2 + 1$

$\endgroup$
2
  • $\begingroup$ Wow thats amazing! How far can you go? At some point you will run into problems, but is 145 the highest one you can achieve? $\endgroup$
    – Nurator
    Feb 26 at 14:06
  • $\begingroup$ @Nurator 146 was the first place I got a bit stuck so I stopped there but if I come up with a way to do it, I'll edit to include this. $\endgroup$
    – hexomino
    Feb 26 at 16:52
5
$\begingroup$

With some dynamic programming we can find all possibilities. Without exponents, we can go to exactly 75:

1: 1 * (2 / (3 + (4 - 5)))
2: (((4 + 5) - 3) / 2) - 1
3: 1 * (((4 + 5) - 3) / 2)
4: (2 + (3 * (5 - 4))) - 1
5: 1 * (2 + (3 * (5 - 4)))
6: 1 + (2 + (3 * (5 - 4)))
7: 1 * (2 + (5 * (4 - 3)))
8: 1 + (2 + (5 * (4 - 3)))
9: 1 + (2 * (3 - (4 - 5)))
10: 1 * (2 * (5 * (4 - 3)))
11: 1 + (2 * (5 * (4 - 3)))
12: 1 * (2 * ((4 + 5) - 3))
13: 1 + (2 * ((4 + 5) - 3))
14: 1 * (2 * ((3 * 4) - 5))
15: 1 + (2 * ((3 * 4) - 5))
16: ((4 + (3 * 5)) - 2) - 1
17: 1 * ((4 + (3 * 5)) - 2)
18: 1 + ((4 + (3 * 5)) - 2)
19: (4 * (5 * (3 - 2))) - 1
20: 1 * (4 * (5 * (3 - 2)))
21: (2 * ((3 * 5) - 4)) - 1
22: 1 * (2 * ((3 * 5) - 4))
23: 1 + (2 * ((3 * 5) - 4))
24: ((3 * (4 + 5)) - 2) - 1
25: 1 * ((3 * (4 + 5)) - 2)
26: 1 + ((3 * (4 + 5)) - 2)
27: (4 * ((2 * 5) - 3)) - 1
28: (2 + (3 * (4 + 5))) - 1
29: 1 * (2 + (3 * (4 + 5)))
30: (3 + (4 * (2 + 5))) - 1
31: 1 * (3 + (4 * (2 + 5)))
32: 1 + (3 + (4 * (2 + 5)))
33: 1 * ((5 * (3 + 4)) - 2)
34: 1 + ((5 * (3 + 4)) - 2)
35: (3 * (4 * (5 - 2))) - 1
36: 1 * (3 * (4 * (5 - 2)))
37: 1 + (3 * (4 * (5 - 2)))
38: (3 * (5 + (2 * 4))) - 1
39: 1 * (3 * (5 + (2 * 4)))
40: 1 + (3 * (5 + (2 * 4)))
41: 1 + (4 * (2 + (3 + 5)))
42: 1 * (3 * (4 + (2 * 5)))
43: 1 + (3 * (4 + (2 * 5)))
44: (5 * (2 + (3 + 4))) - 1
45: (2 * (3 + (4 * 5))) - 1
46: 1 * (2 * (3 + (4 * 5)))
47: ((2 + 4) * (3 + 5)) - 1
48: 1 * ((2 + 4) * (3 + 5))
49: 1 + ((2 + 4) * (3 + 5))
50: 1 * (5 * ((3 * 4) - 2))
51: 1 + (5 * ((3 * 4) - 2))
52: 1 * (4 * ((3 * 5) - 2))
53: (2 * (3 * (4 + 5))) - 1
54: 1 * (2 * (3 * (4 + 5)))
55: 1 + (2 * (3 * (4 + 5)))
56: 1 + (5 * (3 + (2 * 4)))
57: ((3 * (4 * 5)) - 2) - 1
58: 1 * ((3 * (4 * 5)) - 2)
59: 1 - (2 - (3 * (4 * 5)))
60: 2 * (3 * (1 + (4 + 5)))
61: (2 + (3 * (4 * 5))) - 1
62: 1 * (2 + (3 * (4 * 5)))
63: 1 + (2 + (3 * (4 * 5)))
64: 1 * (2 * (4 * (3 + 5)))
65: 1 + (2 * (4 * (3 + 5)))
66: 1 * (3 * (2 + (4 * 5)))
67: 1 + (3 * (2 + (4 * 5)))
68: 1 * (4 * (2 + (3 * 5)))
69: (2 * (5 * (3 + 4))) - 1
70: 1 * (2 * (5 * (3 + 4)))
71: 1 + (2 * (5 * (3 + 4)))
72: 2 * (1 + (5 * (3 + 4)))
73: (3 * (5 * (1 + 4))) - 2
74: 2 + (3 * (4 * (1 + 5)))
75: 3 * (5 * ((2 + 4) - 1))

With exponents, we can go to 177:

76: 1 + (3 * (5 ^ (4 - 2)))
77: (2 - (5 - (3 ^ 4))) - 1
78: (4 + (3 * (5 ^ 2))) - 1
79: 1 * (4 + (3 * (5 ^ 2)))
80: (((2 ^ 3) - 5) ^ 4) - 1
81: 1 * (((2 ^ 3) - 5) ^ 4)
82: 1 + (((2 ^ 3) - 5) ^ 4)
83: ((5 + (3 ^ 4)) - 2) - 1
84: 1 * ((5 + (3 ^ 4)) - 2)
85: 1 + ((5 + (3 ^ 4)) - 2)
86: (3 * (4 + (5 ^ 2))) - 1
87: 1 * (3 * (4 + (5 ^ 2)))
88: 1 + (3 * (4 + (5 ^ 2)))
89: 1 + (2 + (5 + (3 ^ 4)))
90: 1 * (3 * (5 * (2 + 4)))
91: 1 + (3 * (5 * (2 + 4)))
92: 1 * ((3 * (2 ^ 5)) - 4)
93: 1 - (4 - (3 * (2 ^ 5)))
94: (5 * (3 + (2 ^ 4))) - 1
95: 1 * (5 * (3 + (2 ^ 4)))
96: ((4 * (5 ^ 2)) - 3) - 1
97: 1 * ((4 * (5 ^ 2)) - 3)
98: 1 + ((4 * (5 ^ 2)) - 3)
99: (4 * (5 * (2 + 3))) - 1
100: 1 * (4 * (5 * (2 + 3)))
101: 1 + (4 * (5 * (2 + 3)))
102: (3 + (4 * (5 ^ 2))) - 1
103: 1 * (3 + (4 * (5 ^ 2)))
104: 1 + (3 + (4 * (5 ^ 2)))
105: ((5 ^ 2) + (3 ^ 4)) - 1
106: 1 * ((5 ^ 2) + (3 ^ 4))
107: (3 * (4 + (2 ^ 5))) - 1
108: 1 / ((3 ^ (2 - 5)) / 4)
109: 1 + (3 * (4 + (2 ^ 5)))
110: 1 - ((2 ^ 4) - (5 ^ 3))
111: (4 * (3 + (5 ^ 2))) - 1
112: 1 * (4 * (3 + (5 ^ 2)))
113: 1 + (4 * (3 + (5 ^ 2)))
114: 1 + ((2 ^ 5) + (3 ^ 4))
115: (4 * ((2 ^ 5) - 3)) - 1
116: 1 * (4 * ((2 ^ 5) - 3))
117: (2 * ((4 ^ 3) - 5)) - 1
118: (((5 ^ 3) - 4) - 2) - 1
119: (2 * (3 * (4 * 5))) - 1
120: 1 * (2 * (3 * (4 * 5)))
121: 1 + (2 * (3 * (4 * 5)))
122: (2 - (4 - (5 ^ 3))) - 1
123: 1 * (2 - (4 - (5 ^ 3)))
124: 1 - ((4 - (5 ^ 3)) - 2)
125: 1 * ((4 * (2 ^ 5)) - 3)
126: ((4 + (5 ^ 3)) - 2) - 1
127: 1 * ((4 + (5 ^ 3)) - 2)
128: 1 - (2 - (4 + (5 ^ 3)))
129: 1 + (2 ^ ((3 * 4) - 5))
130: (2 + (4 + (5 ^ 3))) - 1
131: 1 * (2 + (4 + (5 ^ 3)))
132: 1 + (2 + (4 + (5 ^ 3)))
133: 1 * (5 + (2 ^ (3 + 4)))
134: 1 + (5 + (2 ^ (3 + 4)))
135: 3 * (5 * (1 + (2 * 4)))
136: 2 * ((5 + (4 ^ 3)) - 1)
137: (2 * (5 + (4 ^ 3))) - 1
138: 1 * (2 * (5 + (4 ^ 3)))
139: 1 + (2 * (5 + (4 ^ 3)))
140: 1 * (4 * (3 + (2 ^ 5)))
141: 1 + (4 * (3 + (2 ^ 5)))
142: 1 + ((2 ^ 4) + (5 ^ 3))
143: ((3 + (4 + 5)) ^ 2) - 1
144: 1 * ((3 + (4 + 5)) ^ 2)
145: 1 + ((3 + (4 + 5)) ^ 2)
146: (1 + (3 ^ (2 + 4))) / 5
147: 3 + (4 * ((1 + 5) ^ 2))
148: (5 + ((3 * 4) ^ 2)) - 1
149: 1 * (5 + ((3 * 4) ^ 2))
150: 1 + (5 + ((3 * 4) ^ 2))
151: (2 * ((3 ^ 4) - 5)) - 1
152: 1 * (2 * ((3 ^ 4) - 5))
153: 1 - (2 * (5 - (3 ^ 4)))
154: 2 * (1 - (5 - (3 ^ 4)))
155: 5 * (((4 ^ 3) / 2) - 1)
156: ((2 * (3 ^ 4)) - 5) - 1
157: 1 * ((2 * (3 ^ 4)) - 5)
158: 1 - (5 - (2 * (3 ^ 4)))
159: ((5 * (4 ^ 3)) / 2) - 1
160: 1 * ((5 * (4 ^ 3)) / 2)
161: 1 + ((5 * (4 ^ 3)) / 2)
162: 2 * (3 ^ (4 * (1 ^ 5)))
163: 3 + (5 * (2 ^ (1 + 4)))
164: 2 * ((1 ^ 5) + (3 ^ 4))
165: 5 * (1 + ((4 ^ 3) / 2))
166: (5 + (2 * (3 ^ 4))) - 1
167: 1 * (5 + (2 * (3 ^ 4)))
168: 1 + (5 + (2 * (3 ^ 4)))
169: (1 + (3 + (4 + 5))) ^ 2
170: 2 * ((5 + (3 ^ 4)) - 1)
171: (2 * (5 + (3 ^ 4))) - 1
172: 1 * (2 * (5 + (3 ^ 4)))
173: 1 + (2 * (5 + (3 ^ 4)))
174: ((3 + 4) * (5 ^ 2)) - 1
175: 1 * ((3 + 4) * (5 ^ 2))
176: 1 + ((3 + 4) * (5 ^ 2))
177: 3 * ((4 ^ (1 + 2)) - 5)

Out the first 500 (nonzero) natural numbers, we can make 395. Out of the first 1000, we can make 554.

Bonus: including integer division only takes us a bit further, to 182.

178: (5 ^ 4) // (3 + (1 / 2))
179: (4 * (5 * (3 ^ 2))) - 1
180: ((2 + (5 / 3)) ^ 4) // 1
181: 1 + (4 * (5 * (3 ^ 2)))
182: (5 ^ (4 - (1 / 3))) // 2

I added flags for modulo and bitwise and/or/xor too, but those don't extend our reach at all beyond 182. Out of binary operations for now...

Bonus 2: When we add concatenation to the original four + exponentiation, it takes us all the way to 668, and covers 980 of the first 1000 numbers!

178: 1 || (2 * (3 || (4 + 5)))
179: 1 || (4 + (3 * (5 ^ 2)))
180: 1 * (4 * (5 * (3 ^ 2)))
181: (2 + (4 ^ (5 - 3))) || 1
182: 1 || ((4 * (5 - 3)) || 2)
183: 1 || (((2 ^ 5) / 4) || 3)
184: 1 || (2 * ((4 || 5) - 3))
185: 1 || ((5 * (3 || 4)) / 2)
186: 1 || (2 + ((3 + 5) || 4))
187: 1 || (3 * (2 || (4 + 5)))
188: 1 || (2 + (5 + (3 ^ 4)))
189: 1 || (((4 + 5) || 2) - 3)
190: 1 || (3 * (5 * (2 + 4)))
191: (2 + ((4 * 5) - 3)) || 1
192: 1 || ((3 * (2 ^ 5)) - 4)
193: 1 || (3 + (2 * (4 || 5)))
194: 1 || ((3 * (5 - 2)) || 4)
195: 1 || (2 + ((4 + 5) || 3))
196: 1 || (2 * (3 + (4 || 5)))
197: 1 || ((4 * (5 ^ 2)) - 3)
198: (((4 * 5) || 2) - 3) - 1
199: 1 || (((2 * 5) || 3) - 4)
200: (((4 * 5) || 3) - 2) - 1
201: (2 + ((5 || 4) / 3)) || 1
202: 1 + (((4 * 5) || 3) - 2)
203: (4 * ((5 || 3) - 2)) - 1
204: 1 * (4 * ((5 || 3) - 2))
205: 1 + (4 * ((5 || 3) - 2))
206: ((5 * (4 || 2)) - 3) - 1
207: 1 * ((5 * (4 || 2)) - 3)
208: ((2 + (5 ^ 4)) / 3) - 1
209: 1 * ((2 + (5 ^ 4)) / 3)
210: (2 || ((3 * 5) - 4)) - 1
211: (2 || ((5 - 4) ^ 3)) || 1
212: 1 + (2 || ((3 * 5) - 4))
213: 1 * (2 || ((5 - 4) || 3))
214: 1 + (2 || ((5 - 4) || 3))
215: (2 || (4 ^ (5 - 3))) - 1
216: 1 * (2 || (4 ^ (5 - 3)))
217: 1 + (2 || (4 ^ (5 - 3)))
218: (2 || (4 + (3 * 5))) - 1
219: 1 * (2 || (4 + (3 * 5)))
220: (((3 * 5) ^ 2) - 4) - 1
221: (2 || (3 + (4 - 5))) || 1
222: 1 - (4 - ((3 * 5) ^ 2))
223: (2 || ((5 - 3) || 4)) - 1
224: 1 * (2 || ((5 - 3) || 4))
225: 1 - (((3 - 5) || 2) || 4)
226: 1 + (((4 || 5) / 3) ^ 2)
227: 1 * (2 || (3 * (4 + 5)))
228: (2 || ((3 || 4) - 5)) - 1
229: (5 * (4 || (2 * 3))) - 1
230: (2 || (3 || (5 - 4))) - 1
231: (2 || (3 * (5 - 4))) || 1
232: 1 + (2 || (3 || (5 - 4)))
233: 1 + ((3 + (4 * 5)) || 2)
234: (2 || (5 * (3 + 4))) - 1
235: 1 * (2 || (5 * (3 + 4)))
236: 1 + (2 || (5 * (3 + 4)))
237: 1 + (4 * (5 || (3 ^ 2)))
238: 1 * (2 || ((4 || 3) - 5))
239: (3 * (5 * (2 ^ 4))) - 1
240: (2 - (4 - (3 ^ 5))) - 1
241: (2 || (3 - (4 - 5))) || 1
242: 1 + (2 - (4 - (3 ^ 5)))
243: 1 + (2 * ((5 ^ 3) - 4))
244: 1 + (3 * ((4 + 5) ^ 2))
245: ((2 * (5 ^ 3)) - 4) - 1
246: 1 * ((2 * (5 ^ 3)) - 4)
247: 1 + ((2 * (5 ^ 3)) - 4)
248: (2 || ((5 || 3) - 4)) - 1
249: 1 * (2 || ((5 || 3) - 4))
250: (2 || ((5 || 4) - 3)) - 1
251: ((5 * (4 - 3)) ^ 2) || 1
252: 1 + (2 || ((5 || 4) - 3))
253: ((5 * (2 + 3)) || 4) - 1
254: (3 * ((2 * 4) || 5)) - 1
255: 1 * (3 * ((2 * 4) || 5))
256: (2 || (3 + (5 || 4))) - 1
257: 1 * (2 || (3 + (5 || 4)))
258: 1 + (2 || (3 + (5 || 4)))
259: 1 + (2 * (4 + (5 ^ 3)))
260: 1 * (2 || (3 * (4 * 5)))
261: (2 * ((5 - 4) || 3)) || 1
262: 2 * (((5 - 4) || 3) || 1)
263: 2 || (3 * (1 + (4 * 5)))
264: 2 * (1 || (4 * (3 + 5)))
265: 2 || (5 * (1 + (3 * 4)))
266: (((5 || 3) || 4) / 2) - 1
267: 1 / (2 / ((5 || 3) || 4))
268: 1 + (((5 || 3) || 4) / 2)
269: (2 * (3 * (4 || 5))) - 1
270: 1 * (2 * (3 * (4 || 5)))
271: (2 || ((3 * 4) - 5)) || 1
272: 1 * ((3 * (4 + 5)) || 2)
273: 1 + ((3 * (4 + 5)) || 2)
274: (2 || ((3 + 4) || 5)) - 1
275: 1 * (2 || ((3 + 4) || 5))
276: 1 + (2 || ((3 + 4) || 5))
277: 1 + (2 || ((3 ^ 4) - 5))
278: 2 * (1 || (3 || (4 + 5)))
279: (2 * (4 * (3 || 5))) - 1
280: 1 * (2 * (4 * (3 || 5)))
281: (2 || (4 * (5 - 3))) || 1
282: 1 * ((5 || (4 ^ 3)) / 2)
283: 1 + ((5 || (4 ^ 3)) / 2)
284: 1 * (2 || ((3 + 5) || 4))
285: (2 || (5 + (3 ^ 4))) - 1
286: 1 * (2 || (5 + (3 ^ 4)))
287: 1 + (2 || (5 + (3 ^ 4)))
288: (((4 * 5) - 3) ^ 2) - 1
289: 1 * (((4 * 5) - 3) ^ 2)
290: 1 + (((4 * 5) - 3) ^ 2)
291: ((3 || (5 - 4)) - 2) || 1
292: 1 * (((3 || 4) - 5) || 2)
293: 1 - ((5 - (3 || 4)) || 2)
294: 1 + (2 || ((4 + 5) || 3))
295: 1 - ((3 - (2 ^ 5)) || 4)
296: 2 * (1 || (3 + (4 || 5)))
297: ((5 ^ 4) - (3 || 1)) / 2
298: 2 * (1 || ((5 || 3) - 4))
299: (3 * (4 * (5 ^ 2))) - 1
300: ((2 + 5) * (4 || 3)) - 1
301: (2 * ((4 || 5) / 3)) || 1
302: 1 + ((2 + 5) * (4 || 3))
303: 1 * ((5 * (2 + 4)) || 3)
304: 1 + ((5 * (2 + 4)) || 3)
305: ((3 || (2 * 5)) - 4) - 1
306: 1 * ((3 || (2 * 5)) - 4)
307: 1 + ((3 || (2 * 5)) - 4)
308: 1 * (2 * ((3 * 5) || 4))
309: (3 || ((4 * 5) / 2)) - 1
310: (((5 ^ 4) - 3) / 2) - 1
311: (2 - (5 - (3 || 4))) || 1
312: 1 + (((5 ^ 4) - 3) / 2)
313: 1 + ((3 || (5 - 4)) || 2)
314: (5 * ((2 + 4) || 3)) - 1
315: 1 * (5 * ((2 + 4) || 3))
316: 1 + (5 * ((2 + 4) || 3))
317: ((3 || (4 * 5)) - 2) - 1
318: (3 || ((2 || 4) - 5)) - 1
319: 1 * (3 || ((2 || 4) - 5))
320: (3 || (2 || (5 - 4))) - 1
321: ((3 * (5 - 4)) || 2) || 1
322: 1 + (3 || (2 || (5 - 4)))
323: (((5 || 4) / 3) ^ 2) - 1
324: 1 * (((5 || 4) / 3) ^ 2)
325: 1 + (((5 || 4) / 3) ^ 2)
326: 1 + (3 || (5 ^ (4 - 2)))
327: (3 || ((2 ^ 5) - 4)) - 1
328: 1 * (3 || ((2 ^ 5) - 4))
329: 1 + (3 || ((2 ^ 5) - 4))
330: 1 * (3 || (5 * (2 + 4)))
331: (2 + (3 || (5 - 4))) || 1
332: 1 * (3 || (4 ^ (5 / 2)))
333: 1 + (3 || (4 ^ (5 / 2)))
334: 1 * (3 || ((5 - 2) || 4))
335: 1 + (3 || ((5 - 2) || 4))
336: 1 * (3 || (4 + (2 ^ 5)))
337: 1 + (3 || (4 + (2 ^ 5)))
338: (((2 + 5) ^ 3) - 4) - 1
339: 1 * (((2 + 5) ^ 3) - 4)
340: 1 - (4 - ((2 + 5) ^ 3))
341: (2 + (4 * (3 + 5))) || 1
342: ((3 || (4 || 5)) - 2) - 1
343: 1 * ((3 || (4 || 5)) - 2)
344: 1 + ((3 || (4 || 5)) - 2)
345: (3 || ((5 || 1) - 4)) - 2
346: (2 + (3 || (4 || 5))) - 1
347: 1 * (2 + (3 || (4 || 5)))
348: 1 + (2 + (3 || (4 || 5)))
349: 1 + (3 || ((5 || 2) - 4))
350: 2 * (1 || ((3 + 4) || 5))
351: (3 + (4 ^ (5 / 2))) || 1
352: 1 * ((5 * (3 + 4)) || 2)
353: 1 + ((5 * (3 + 4)) || 2)
354: 1 * ((3 + (2 ^ 5)) || 4)
355: 1 + ((3 + (2 ^ 5)) || 4)
356: 1 * (2 + (3 || (5 || 4)))
357: 1 + (2 + (3 || (5 || 4)))
358: 1 * (3 || (5 || (2 * 4)))
359: (3 * (5 * (2 || 4))) - 1
360: ((4 + (3 * 5)) ^ 2) - 1
361: (((4 + 5) - 3) ^ 2) || 1
362: 1 + ((4 + (3 * 5)) ^ 2)
363: (3 || (4 ^ (5 - 2))) - 1
364: (3 || ((2 + 4) || 5)) - 1
365: 1 * (3 || ((2 + 4) || 5))
366: 1 + (3 || ((2 + 4) || 5))
367: 3 || (((2 + 5) || 1) - 4)
368: 2 * (1 || ((3 + 5) || 4))
369: 3 * ((5 ^ (4 - 1)) - 2)
370: 3 || (2 * ((4 - 1) || 5))
371: (2 + (5 * (3 + 4))) || 1
372: (((4 || 2) - 5) || 3) - 1
373: 1 * (((4 || 2) - 5) || 3)
374: 1 + (((4 || 2) - 5) || 3)
375: 1 + (3 || ((2 + 5) || 4))
376: (1 || (4 * (2 ^ 5))) / 3
377: 2 + (3 * (5 ^ (4 - 1)))
378: ((2 || 1) * (5 || 4)) / 3
379: (3 || (5 * (2 ^ 4))) - 1
380: (3 || ((4 + 5) ^ 2)) - 1
381: (2 * (4 + (3 * 5))) || 1
382: 1 - ((2 - 5) || (3 ^ 4))
383: 1 - ((5 - (4 || 3)) || 2)
384: 1 * (3 * (4 * (2 ^ 5)))
385: 1 + (3 * (4 * (2 ^ 5)))
386: 1 + (3 || ((2 * 4) || 5))
387: 2 + (((4 || 1) - 3) || 5)
388: 3 || (2 * ((4 || 5) - 1))
389: (3 || (2 * (4 || 5))) - 1
390: 1 * (3 || (2 * (4 || 5)))
391: (3 * ((5 || 2) / 4)) || 1
392: 1 * ((3 || (4 + 5)) || 2)
393: 1 + ((3 || (4 + 5)) || 2)
394: (((4 || 2) - 3) || 5) - 1
395: 1 * (((4 || 2) - 3) || 5)
396: (((4 * 5) ^ 2) - 3) - 1
397: 1 * (((4 * 5) ^ 2) - 3)
398: 1 - (3 - ((4 * 5) ^ 2))
399: 3 || ((4 * (5 ^ 2)) - 1)
400: (5 / ((3 / 4) - 1)) ^ 2
401: (((4 || 5) - 3) - 2) || 1
402: ((5 * (3 ^ 4)) - 2) - 1
403: ((5 * (2 ^ 3)) || 4) - 1
404: 1 * ((5 * (2 ^ 3)) || 4)
405: (2 * ((4 * 5) || 3)) - 1
406: 1 * (2 * ((4 * 5) || 3))
407: 1 + (2 * ((4 * 5) || 3))
408: 1 + (2 + (5 * (3 ^ 4)))
409: (4 || (2 + (3 + 5))) - 1
410: (4 || (5 + (2 * 3))) - 1
411: (2 + (3 || (4 + 5))) || 1
412: 1 + (4 || (5 + (2 * 3)))
413: (4 || (5 + (3 ^ 2))) - 1
414: 1 * (4 || (5 + (3 ^ 2)))
415: (4 || (2 * (3 + 5))) - 1
416: 1 * (4 || (2 * (3 + 5)))
417: 1 + (4 || (2 * (3 + 5)))
418: 1 + (2 + (4 || (3 * 5)))
419: 1 - (5 - ((4 || 2) || 3))
420: (4 || (3 * (2 + 5))) - 1
421: ((3 - (4 - 5)) || 2) || 1
422: 1 + (4 || (3 * (2 + 5)))
423: (2 * (4 * (5 || 3))) - 1
424: 1 * (2 * (4 * (5 || 3)))
425: 1 + (2 * (4 * (5 || 3)))
426: 1 + (4 || (5 * (2 + 3)))
427: (3 + (4 || (5 ^ 2))) - 1
428: ((4 || (2 ^ 5)) - 3) - 1
429: 1 * ((4 || (2 ^ 5)) - 3)
430: 1 - (3 - (4 || (2 ^ 5)))
431: ((5 + (3 ^ 4)) / 2) || 1
432: ((4 || (3 || 5)) - 2) - 1
433: 1 * ((4 || (3 || 5)) - 2)
434: 1 + ((4 || (3 || 5)) - 2)
435: 1 * (3 + (4 || (2 ^ 5)))
436: 1 + (3 + (4 || (2 ^ 5)))
437: 1 * (2 + (4 || (3 || 5)))
438: 1 + (2 + (4 || (3 || 5)))
439: (4 || (5 * (2 ^ 3))) - 1
440: 1 * (4 || (5 * (2 ^ 3)))
441: (2 + ((4 || 5) - 3)) || 1
442: (3 + (4 || (1 ^ 5))) || 2
443: (4 || (3 * (1 || 5))) - 2
444: (4 || (5 * (3 ^ 2))) - 1
445: 1 * (4 || (5 * (3 ^ 2)))
446: 1 + (4 || (5 * (3 ^ 2)))
447: ((2 + 5) * (4 ^ 3)) - 1
448: (((4 || 5) || 2) - 3) - 1
449: 1 * (((4 || 5) || 2) - 3)
450: (((4 || 5) || 3) - 2) - 1
451: (((5 || 2) - 4) - 3) || 1
452: 1 + (((4 || 5) || 3) - 2)
453: ((5 * (3 ^ 2)) || 4) - 1
454: 1 * ((5 * (3 ^ 2)) || 4)
455: 1 + ((5 * (3 ^ 2)) || 4)
456: 1 + (2 + ((4 || 5) || 3))
457: 1 + (4 || (5 || (2 * 3)))
458: 1 * (4 || (5 || (2 ^ 3)))
459: (4 * (5 * (2 || 3))) - 1
460: 1 * (4 * (5 * (2 || 3)))
461: (2 * (3 + (4 * 5))) || 1
462: 2 * ((3 + (4 * 5)) || 1)
463: (4 || ((3 + 5) ^ 2)) - 1
464: (4 || ((2 * 3) || 5)) - 1
465: 1 * (4 || ((2 * 3) || 5))
466: 1 + (4 || ((2 * 3) || 5))
467: 2 + (4 || (5 * (1 || 3)))
468: ((2 + (4 || 5)) || 1) - 3
469: (4 || (2 * (3 || 5))) - 1
470: 1 * (4 || (2 * (3 || 5)))
471: (((5 || 3) - 4) - 2) || 1
472: ((2 + (4 || 5)) || 3) - 1
473: 1 * ((2 + (4 || 5)) || 3)
474: 1 + ((2 + (4 || 5)) || 3)
475: 1 * (4 || (3 * (5 ^ 2)))
476: 1 + (4 || (3 * (5 ^ 2)))
477: (2 * ((3 ^ 5) - 4)) - 1
478: 1 * (2 * ((3 ^ 5) - 4))
479: 1 - (2 * (4 - (3 ^ 5)))
480: 2 * (1 - (4 - (3 ^ 5)))
481: (2 * ((5 - 3) || 4)) || 1
482: 1 * ((3 + (4 || 5)) || 2)
483: 1 - (4 - (2 * (3 ^ 5)))
484: (4 || ((2 ^ 3) || 5)) - 1
485: 1 * (4 || ((2 ^ 3) || 5))
486: 1 + (4 || ((2 ^ 3) || 5))
487: 1 + ((4 * (3 ^ 5)) / 2)
488: 2 * ((1 ^ 4) + (3 ^ 5))
489: (4 + (2 * (3 ^ 5))) - 1
490: 1 * (4 + (2 * (3 ^ 5)))
491: (((5 || 4) - 3) - 2) || 1
492: 1 * (((5 || 3) - 4) || 2)
493: 1 - ((4 - (5 || 3)) || 2)
494: 1 * (2 * (4 + (3 ^ 5)))
495: 1 + (2 * (4 + (3 ^ 5)))
496: 1 + (3 * ((2 ^ 4) || 5))
497: ((4 * (5 ^ 3)) - 2) - 1
498: 1 * ((4 * (5 ^ 3)) - 2)
499: 1 - (2 - (4 * (5 ^ 3)))
500: ((1 + (4 + 5)) ^ 3) / 2
501: (2 + (3 + (4 || 5))) || 1
502: 1 * (2 + (4 * (5 ^ 3)))
503: 1 + (2 + (4 * (5 ^ 3)))
504: 2 * (4 * ((1 + 5) || 3))
505: (((5 || 1) || 2) - 4) - 3
506: (((2 * 4) ^ 3) - 5) - 1
507: (4 * (2 + (5 ^ 3))) - 1
508: ((2 ^ (4 + 5)) - 3) - 1
509: ((5 || (3 * 4)) - 2) - 1
510: (5 || (3 + (2 * 4))) - 1
511: (2 - (4 - (5 || 3))) || 1
512: 1 + (5 || (3 + (2 * 4)))
513: 1 * ((5 || (2 ^ 4)) - 3)
514: 1 + ((5 || (2 ^ 4)) - 3)
515: 1 * (3 + (2 ^ (4 + 5)))
516: (5 || ((3 || 4) / 2)) - 1
517: 1 * (5 || ((3 || 4) / 2))
518: 1 + (5 || ((3 || 4) / 2))
519: 1 + (5 || (3 * (2 + 4)))
520: (((5 || 2) || 4) - 3) - 1
521: ((5 * (4 - 3)) || 2) || 1
522: 1 + (((5 || 2) || 4) - 3)
523: (5 || (2 * (3 * 4))) - 1
524: 1 * (5 || (2 * (3 * 4)))
525: 1 + (5 || (2 * (3 * 4)))
526: (3 + ((5 || 2) || 4)) - 1
527: 1 * (3 + ((5 || 2) || 4))
528: ((3 + (4 * 5)) ^ 2) - 1
529: 1 * ((3 + (4 * 5)) ^ 2)
530: 1 + ((3 + (4 * 5)) ^ 2)
531: (2 + ((5 || 4) - 3)) || 1
532: 1 * (((5 || 3) || 4) - 2)
533: 1 + (((5 || 3) || 4) - 2)
534: (2 + (5 || (1 ^ 3))) || 4
535: (2 + ((5 || 3) || 4)) - 1
536: 1 * (2 + ((5 || 3) || 4))
537: 1 + (2 + ((5 || 3) || 4))
538: (((5 || 4) || 2) - 3) - 1
539: 1 * (((5 || 4) || 2) - 3)
540: (((5 || 4) || 3) - 2) - 1
541: (2 * (3 * (4 + 5))) || 1
542: 1 + (((5 || 4) || 3) - 2)
543: 2 + (5 || (4 || (1 ^ 3)))
544: (2 + ((5 || 4) || 3)) - 1
545: 1 * (2 + ((5 || 4) || 3))
546: 1 + (2 + ((5 || 4) || 3))
547: 1 + (5 || (4 || (2 * 3)))
548: (5 || ((3 + 4) ^ 2)) - 1
549: 1 * (5 || ((3 + 4) ^ 2))
550: 1 + (5 || ((3 + 4) ^ 2))
551: ((3 + (5 || 4)) - 2) || 1
552: (4 + (5 || (1 ^ 3))) || 2
553: ((2 + (5 || 3)) || 4) - 1
554: 1 * ((2 + (5 || 3)) || 4)
555: 1 + ((2 + (5 || 3)) || 4)
556: 5 || ((1 || (3 * 4)) / 2)
557: ((5 || (2 * 3)) || 1) - 4
558: (5 * (1 || (3 * 4))) - 2
559: ((2 ^ 4) * (3 || 5)) - 1
560: 1 * ((2 ^ 4) * (3 || 5))
561: (4 * (5 + (3 ^ 2))) || 1
562: ((2 + (5 || 4)) || 3) - 1
563: 1 * ((2 + (5 || 4)) || 3)
564: 1 + ((2 + (5 || 4)) || 3)
565: 1 + ((5 || (2 * 3)) || 4)
566: 1 * (2 + (5 || (4 ^ 3)))
567: 1 + (2 + (5 || (4 ^ 3)))
568: 1 * (5 || (2 * (3 || 4)))
569: 1 + (5 || (2 * (3 || 4)))
570: (1 || (4 * (3 || 5))) / 2
571: (((4 ^ 3) - 5) - 2) || 1
572: 1 * ((3 + (5 || 4)) || 2)
573: 1 + ((3 + (5 || 4)) || 2)
574: (1 + (5 || (2 * 3))) || 4
575: (((5 - 3) || 4) ^ 2) - 1
576: 1 * (((5 - 3) || 4) ^ 2)
577: 1 + (((5 - 3) || 4) ^ 2)
578: ((5 || (3 ^ 4)) - 2) - 1
579: 1 * ((5 || (3 ^ 4)) - 2)
580: 1 - (2 - (5 || (3 ^ 4)))
581: (2 * ((3 || 4) - 5)) || 1
582: (2 + (5 || (3 ^ 4))) - 1
583: 1 * (2 + (5 || (3 ^ 4)))
584: 1 + (2 + (5 || (3 ^ 4)))
585: 1 + ((5 || (2 ^ 3)) || 4)
586: 1 * (5 || (2 * (4 || 3)))
587: 1 + (5 || (2 * (4 || 3)))
588: 3 * (((1 ^ 5) || 4) ^ 2)
589: (((4 ^ 3) - 5) || 1) - 2
590: 5 * (1 || (3 * (2 + 4)))
591: (2 + (3 + (5 || 4))) || 1
592: 1 * (((4 ^ 3) - 5) || 2)
593: 1 + (((4 ^ 3) - 5) || 2)
594: 1 * ((5 || (3 ^ 2)) || 4)
595: 1 + ((5 || (3 ^ 2)) || 4)
596: 2 + ((5 ^ 4) - (3 || 1))
597: 3 * (((4 * 5) || 1) - 2)
598: (5 ^ 4) - (3 ^ (1 + 2))
599: ((3 * (4 * 5)) || 1) - 2
600: 5 * (1 || (4 * (2 + 3)))
601: (4 * ((3 - 2) || 5)) || 1
602: 1 * ((3 * (4 * 5)) || 2)
603: 1 + ((3 * (4 * 5)) || 2)
604: 4 * (((3 - 2) || 5) || 1)
605: (3 * ((4 * 5) || 2)) - 1
606: 1 * (3 * ((4 * 5) || 2))
607: 1 + (3 * ((4 * 5) || 2))
608: 1 * (4 * ((3 * 5) || 2))
609: 1 + (4 * ((3 * 5) || 2))
610: 1 * (5 * ((3 * 4) || 2))
611: (2 + ((4 ^ 3) - 5)) || 1
612: (((4 + 5) - 3) || 1) || 2
613: (3 * (5 * (4 || 1))) - 2
614: ((2 + 4) || (3 * 5)) - 1
615: 1 * ((2 + 4) || (3 * 5))
616: 1 + ((2 + 4) || (3 * 5))
617: 1 + ((5 ^ 4) - (3 ^ 2))
618: ((5 ^ 4) - (2 * 3)) - 1
619: (((5 ^ 4) - 3) - 2) - 1
620: 1 * (((5 ^ 4) - 3) - 2)
621: (2 * (3 || (5 - 4))) || 1
622: 2 * ((3 || (5 - 4)) || 1)
623: (2 - (3 - (5 ^ 4))) - 1
624: 1 * (2 - (3 - (5 ^ 4)))
625: ((3 + (5 ^ 4)) - 2) - 1
626: 1 * ((3 + (5 ^ 4)) - 2)
627: 1 + ((3 + (5 ^ 4)) - 2)
628: 1 + (((5 ^ 3) || 4) / 2)
629: (2 + (3 + (5 ^ 4))) - 1
630: ((2 * 3) + (5 ^ 4)) - 1
631: (3 * (2 || (5 - 4))) || 1
632: 1 + ((2 * 3) + (5 ^ 4))
633: ((3 ^ 2) + (5 ^ 4)) - 1
634: 1 * ((3 ^ 2) + (5 ^ 4))
635: 1 + ((3 ^ 2) + (5 ^ 4))
636: 1 + (((2 + 4) || 3) || 5)
637: 1 * (((4 ^ 3) || 2) - 5)
638: 1 - (5 - ((4 ^ 3) || 2))
639: (2 * (3 || (4 * 5))) - 1
640: 1 * (2 * (3 || (4 * 5)))
641: (2 ^ ((4 + 5) - 3)) || 1
642: (((4 ^ 3) || 5) - 2) - 1
643: 1 * (((4 ^ 3) || 5) - 2)
644: 1 + (((4 ^ 3) || 5) - 2)
645: 1 + (((3 + 5) ^ 2) || 4)
646: 1 + (((2 * 3) || 4) || 5)
647: ((2 || 3) + (5 ^ 4)) - 1
648: 1 * ((2 || 3) + (5 ^ 4))
649: 1 + ((2 || 3) + (5 ^ 4))
650: 2 * (3 || (5 * (1 + 4)))
651: (5 * ((2 ^ 4) - 3)) || 1
652: (((2 + 4) || 5) || 3) - 1
653: 1 * (((2 + 4) || 5) || 3)
654: 1 + (((2 + 4) || 5) || 3)
655: 1 + (((2 * 3) || 5) || 4)
656: ((3 || 2) + (5 ^ 4)) - 1
657: 1 * ((3 || 2) + (5 ^ 4))
658: 1 + ((3 || 2) + (5 ^ 4))
659: (3 * (2 || (4 * 5))) - 1
660: 1 * (3 * (2 || (4 * 5)))
661: (3 * (2 + (4 * 5))) || 1
662: (((3 + 4) || 1) - 5) || 2
663: 3 * ((2 + (4 * 5)) || 1)
664: ((2 + (4 ^ 3)) || 5) - 1
665: 1 * ((2 + (4 ^ 3)) || 5)
666: 1 + ((2 + (4 ^ 3)) || 5)
667: (4 || 2) + (5 ^ (1 + 3))
668: (5 * (1 || (3 || 4))) - 2

Bonus 3: If we extend this to include 6 (output), we cover 9965 of the first 10000, the first one we fail to make isn't until 5989.

$\endgroup$
7
  • 1
    $\begingroup$ Thats so cool to see!!! Isnt it amazing that division actually helps you? I remember being stuck at 146 forever! $\endgroup$
    – Nurator
    Feb 27 at 8:12
  • 1
    $\begingroup$ Beautiful code! $\endgroup$ Feb 27 at 12:00
  • $\begingroup$ To the Bonus 2: And all that with the numbers 1 to 5 :) I wonder how far you can get when you allow to use 6... $\endgroup$
    – Nurator
    Feb 27 at 14:20
  • $\begingroup$ @Nurator Here is [the output for 1-5000 using 5 ints in [1, 6] w/o repeats, allowing exponentiation and concatenation](pastebin.com/raw/wDEvCRF9). It covers 4763 of those 5000, and the first one it misses is 1487. Note: for the above output, it only uses 5 out of 6 of the numbers. Running the program the "correct" way now, but the runtime is pretty horrendous. $\endgroup$
    – jt3280
    Feb 27 at 23:50
  • $\begingroup$ Awesome! I can imagine the run time must be absurd :D But cool that you can actually program it in a way that it works :) $\endgroup$
    – Nurator
    Mar 1 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.