From 9cff05c81b8d7b6efc7aa52b8841a9d070491c07 Mon Sep 17 00:00:00 2001 From: Peter Norvig Date: Fri, 2 Jan 2026 18:44:18 -0800 Subject: [PATCH] Add files via upload --- ipynb/Countdown.ipynb | 438 +++++++++++++++++++++++------------------- 1 file changed, 241 insertions(+), 197 deletions(-) diff --git a/ipynb/Countdown.ipynb b/ipynb/Countdown.ipynb index 3de5c60..15204cf 100644 --- a/ipynb/Countdown.ipynb +++ b/ipynb/Countdown.ipynb @@ -206,8 +206,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 12.5 s, sys: 272 ms, total: 12.8 s\n", - "Wall time: 12.8 s\n" + "CPU times: user 12.7 s, sys: 255 ms, total: 12.9 s\n", + "Wall time: 12.9 s\n" ] }, { @@ -861,7 +861,7 @@ { "data": { "text/plain": [ - "{1: '1', 2: '2', 0.5: '(1/2)', 3: '(1+2)', -1: '(1-2)'}" + "{1: '1', 2: '2', 3: '(1+2)', -1: '(1-2)', 0.5: '(1/2)'}" ] }, "execution_count": 18, @@ -960,7 +960,7 @@ " 5: (44-4!)/4 20: (44-4)/√4 35: 4!+(44/4) 50: 4+(√4+44) 65: (4+(4^4))/4 \n", " 6: √(44-(4+4)) 21: (4+4.4)/.4 36: 44-(4+4) 51: (.4-(4-4!))/.4 66: 4!-(√4-44) \n", " 7: (44/4)-4 22: √4/(4/44) 37: 4!+((√4+4!)/√4) 52: 4+(4+44) 67: √4+((√4+4!)/.4)\n", - " 8: 4+(4.4-.4) 23: (√4+44)/√4 38: 44-(4+√4) 53: 4!+(4!+(√4/.4)) 68: 44+√(4*4)! \n", + " 8: 4-(.4-4.4) 23: (√4+44)/√4 38: 44-(4+√4) 53: 4!+(4!+(√4/.4)) 68: 44+√(4*4)! \n", " 9: (44/4)-√4 24: 4+(44-4!) 39: 44-(√4/.4) 54: 44+(4/.4) 69: 4+((√4+4!)/.4) \n", " 10: 44/4.4 25: 4!+(4^(4-4)) 40: 44-√(4*4) 55: 44/(.4+.4) 70: √4+(4!+44) \n", " 11: 44/√(4*4) 26: 4+(44/√4) 41: (.4+(4*4))/.4 56: 44+(4!/√4) 71: (4!+4.4)/.4 \n", @@ -1064,7 +1064,7 @@ "\n", " 0: 22-22 6: √((22/2)-2)! 12: (2+22)/2 18: 22-(2+2) 24: 2+(√22^2) 30: (2+(2+2))/.2 \n", " 1: 22/22 7: 2+(2/(2*.2)) 13: 2+(22/2) 19: (2+(2-.2))/.2 25: (2-2.2)^-2 \n", - " 2: (2+2)!-22 8: 2^(2+(2/2)) 14: (2^(2+2))-2 20: 22-(√2^2) 26: 2+(2+22) \n", + " 2: (2+2)!-22 8: 2+(2+(2+2)) 14: (2^(2+2))-2 20: 22-(√2^2) 26: 2+(2+22) \n", " 3: √((22/2)-2) 9: (22/2)-2 15: (2+(2/2))/.2 21: 22-(2/2) 27: 22+(√.2^-2) \n", " 4: .2*(22-2) 10: 22/2.2 16: 2*(2*(2+2)) 22: √22*√22 28: 2+(2+(2+2)!) \n", " 5: 2+(2+(2/2)) 11: 22/(√2^2) 17: 22-(√.2^-2) 23: 22+(2/2) 29: 2+(2+(.2^-2))\n" @@ -1151,8 +1151,8 @@ " 2: 5!/(5+55) 9: 5+(5-(5/5)) 16: 5+(55/5) 23: 55-(.5^-5) 30: 55-(5*5) 37: 5+(.5^-√(5*5))\n", " 3: 5.5-(5*.5) 10: 55/5.5 17: 5+(5!/(5+5)) 24: √(5+(55/5))! 31: 55-(5!/5) 38: ((5!/5)-5)/.5 \n", " 4: √(5+(55/5)) 11: 5.5+5.5 18: ((5!-5)/5)-5 25: .5*(55-5) 32: (5.5-5)^-5 \n", - " 5: (.5*5!)-55 12: (5+55)/5 19: (5!-(5*5))/5 26: (5/5)+(5*5) 33: .5*(5!*.55) \n", - " 6: (55/5)-5 13: (5!-55)/5 20: 5*(5-(5/5)) 27: (5*5.5)-.5 34: 5+(5+(5!/5)) \n" + " 5: (.5*5!)-55 12: (5+55)/5 19: (5!-(5*5))/5 26: (5*5)+(5/5) 33: .5*(5!*.55) \n", + " 6: (55/5)-5 13: (5!-55)/5 20: 5+(5+(5+5)) 27: (5*5.5)-.5 34: 5+(5+(5!/5)) \n" ] } ], @@ -1205,17 +1205,17 @@ "name": "stdout", "output_type": "stream", "text": [ - "10: 2+(0+(1*8)) 20-(1+9) 20/(2+0) 20/(2/1) 20/√(2+2) √(20*(2+3)) 20*(2/4) \n", + "10: 2+(0+(1*8)) 20-(1+9) 20/(2+0) 20/(2*1) 20/√(2+2) √(20*(2+3)) 20*(2/4) \n", " 9: 2-(0+(1-8)) (2*0)+(1*9) (20/2)-0! (20/2)-1 (20-2)/2 2+(0!+(2*3)) (20-2)/√4 \n", " 8: (2*0)+(1*8) (2*0)-(1-9) 2+(0+(2+0!)!) 2+(0+(2+1)!) (20/2)-2 20-(2*3!) (20/2)-√4 \n", " 7: (2*0)-(1-8) (20+1)/√9 (2*(0!+2))+0! (2*(0!+2))+1 2+(0!+(2+2)) (20/2)-3 2+√(0!+24) \n", - " 6: √(2*(0+18)) (2+(0/19)!)! (2+(0/20)!)! (2+(0/21)!)! √((20-2)*2) (-20+23)! (20/2)-4 \n", + " 6: √(2*(0+18)) (2+(0*19)!)! (2+(0*20)!)! (2+(0*21)!)! √((20-2)*2) (-20+23)! (20/2)-4 \n", " 5: 2+(0+√(1+8)) 20/(1+√9) 2+(0+(2+0!)) 2+(0+(2+1)) 20/(2+2) √(2+(0+23)) 20/(2+√4) \n", - " 4: √(-2+(0+18)) √(20-(1+√9)) 2+(0+(2+0)) 2+(0+(2/1)) √(20-(2+2)) 20/(2+3) -20+24 \n", - " 3: 2+(0/18)! 2+(0/19)! 2+(0/20)! 2+(0/21)! 2+(0/22)! -20+23 2+(0/24)! \n", - " 2: 20-18 2+(0/19) 2+(0/20) 2+(0/21) -20+22 2+(0/23) √(-20+24) \n", - " 1: 2-(0/18)! 20-19 20/20 -20+21 2-(0/22)! 2-(0/23)! 2-(0/24)! \n", - " 0: 2*(0/18) 2*(0/19) 20-20 2*(0/21) 2*(0/22) 2*(0/23) 2*(0/24) \n" + " 4: √(-2+(0+18)) √(20-(1+√9)) 2+(0+(2+0)) 2+(0+(2*1)) √(20-(2+2)) 20/(2+3) -20+24 \n", + " 3: 2+(0*18)! 2+(0*19)! 2+(0*20)! 2+(0*21)! 2+(0*22)! -20+23 2+(0*24)! \n", + " 2: 20-18 2+(0*19) 2+(0*20) 2+(0*21) -20+22 2+(0*23) √(-20+24) \n", + " 1: 2-(0*18)! 20-19 20/20 -20+21 2-(0*22)! 2-(0*23)! 2-(0*24)! \n", + " 0: 2*(0*18) 2*(0*19) 20-20 2*(0*21) 2*(0*22) 2*(0*23) 2*(0*24) \n" ] } ], @@ -1236,13 +1236,13 @@ " 9: 2-(0!-(2+6)) √((2+0!)*27) (2/(0+2))+8 -20+29 (2+0!)*(3+0) 2+(0+(3!+1)) 2+(0!+(3*2)) \n", " 8: 20-(2*6) (2/(0+2))+7 -20+28 20-(2*√9!) 2*(0+(3+0!)) √(2*(0!+31)) 20-(3!*2) \n", " 7: 2+√(-0!+26) -20+27 (2/(0-2))+8 √(20+29) (2*(0+3))+0! (2*(0+3))+1 (20-3!)/2 \n", - " 6: -20+26 20-(2*7) √(20+(2*8)) √(-20+29)! (2+(0/30)!)! (2+(0/31)!)! (2+(0/32)!)! \n", + " 6: -20+26 20-(2*7) √(20+(2*8)) √(-20+29)! (2+(0*30)!)! (2+(0*31)!)! (2+(0*32)!)! \n", " 5: 20/(-2+6) √(20-(2-7)) 20*(2/8) √(20+(2+√9)) 20/(3+0!) 20/(3+1) 20/(3!-2) \n", " 4: (20/2)-6 20/(-2+7) 20-(2*8) 20/(2+√9) 20/(3!-0!) 20/(3!-1) 20/(3+2) \n", - " 3: (20-2)/6 (20/2)-7 2+(0/28)! √(-20+29) 2+(0/30)! 2+(0/31)! 2+(0/32)! \n", - " 2: 2+(0/26) 2+(0/27) 2+(0/28) 2+(0/29) 2+(0/30) 2+(0/31) 2+(0/32) \n", - " 1: 2-(0/26)! 2-(0/27)! 2-(0/28)! (20/2)-9 (203*0)! 2-(0/31)! 2-(0/32)! \n", - " 0: 2*(0/26) 2*(0/27) 2*(0/28) 2*(0/29) 203*0 2*(0/31) 2*(0/32) \n" + " 3: (20-2)/6 (20/2)-7 2+(0*28)! √(-20+29) 2+(0*30)! 2+(0*31)! 2+(0*32)! \n", + " 2: 2+(0*26) 2+(0*27) 2+(0*28) 2+(0*29) 2+(0*30) 2+(0*31) 2+(0*32) \n", + " 1: 2-(0*26)! 2-(0*27)! 2-(0*28)! (20/2)-9 (203*0)! 2-(0*31)! 2-(0*32)! \n", + " 0: 2*(0*26) 2*(0*27) 2*(0*28) 2*(0*29) 203*0 2*(0*31) 2*(0*32) \n" ] } ], @@ -1306,8 +1306,8 @@ "data": { "text/plain": [ "{'(((3^2)-3)*4)',\n", - " '(((4/2)^3)*3)',\n", - " '(3*((4/2)^3))',\n", + " '(((4-2)^3)*3)',\n", + " '(3*((4-2)^3))',\n", " '(3*(4^(3/2)))',\n", " '(3/((2/4)^3))',\n", " '(4*((3^2)-3))'}" @@ -1352,7 +1352,7 @@ " '((2^3)+(8+8))',\n", " '((8-(3+2))*8)',\n", " '((8^2)/(8/3))',\n", - " '(3*((8^2)/8))',\n", + " '(3*((8*2)-8))',\n", " '(3/(2/(8+8)))',\n", " '(3/(8/(8^2)))',\n", " '(8*(8-(2+3)))',\n", @@ -1438,10 +1438,10 @@ " '(2*(6*(6/3)))',\n", " '(2*(6/(3/6)))',\n", " '(2/(3/(6*6)))',\n", - " '(6*(2+(6/3)))',\n", - " '(6*(2/(3/6)))',\n", " '(6*(6*(2/3)))',\n", " '(6*(6/(3/2)))',\n", + " '(6+(2*(3+6)))',\n", + " '(6+(2*(6+3)))',\n", " '(6/(3/(2*6)))',\n", " '(6/(3/(6*2)))'}" ] @@ -1586,7 +1586,9 @@ "source": [ "# License Plate Game\n", "\n", - "**Aarati Marino** writes \"the kids and I just devised a cool game to play in the car this morning. Just take the last 4 digits of the license plate in front of you, and use addition, subtraction, multiplication, and division to make 24.\" That sounds like fun. I remember a similar game, but the goal was to make an equation: that is, on seeing the plate \"2346\", my game is to find an equation such as \"6/3 = 4/2\", possibly using operators other than the basic four. Let's see how many plates we can solve for both versions of the game. First off, how many unique 4-digit license plates are there? It is not 1000, because we're dealing with combinations rather than permutations:" + "**Aarati Marino** writes \"the kids and I just devised a cool game to play in the car this morning. Just take the last 4 digits of the license plate in front of you, and use addition, subtraction, multiplication, and division to make 24.\" That sounds like fun. \n", + "\n", + "I remember a similar game, but the goal was to make an equation: that is, on seeing the plate \"2346\", my game is to find an equation such as \"6/3 = 4/2\", possibly using operators other than the basic four. Let's see how many plates we can solve for both versions of the game. First off, how many unique 4-digit license plates are there? It is not 10,000, because we're dealing with combinations rather than permutations:" ] }, { @@ -1613,6 +1615,7 @@ { "cell_type": "markdown", "metadata": { + "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ @@ -1620,8 +1623,10 @@ "- First, just the basic four operations (allowing digit concatenation).\n", "- Second, allow exponentiation, square root, and factorial.\n", "- Third, also allowing decimal points.\n", + "- Either Aarti's or Peter's game (24 or equation).\n", + "- Output in a readable format.\n", "\n", - "And I want to see the results printed in a nice format, and I want the same function to handle either Aarti's game or Peter's game. This is what I came up with: " + "This is what I came up with: " ] }, { @@ -1643,6 +1648,13 @@ " plates = unsolved" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "First Aarti's game:" + ] + }, { "cell_type": "code", "execution_count": 41, @@ -1659,17 +1671,17 @@ "0036: 0+(30-6) 0588: (80/5)+8 1348: 38-14 2266: (2+6)/(2/6) 3335: (3*3)+(3*5) 4458: (4+(4-5))*8 \n", "0038: 0+(0+(3*8)) 0666: 60-(6*6) 1349: 43-19 2267: 2/(6/72) 3336: 33-(3+6) 4459: 4*(54/9) \n", "0046: 0+(0+(4*6)) 0669: 90-66 1355: 55-31 2268: 22-(6-8) 3337: 3*((3/3)+7) 4468: 68-44 \n", - "0114: 10+14 0689: 0-((6-9)*8) 1356: 13+(5+6) 2269: 96/(2+2) 3338: 3*(3/(3/8)) 4469: 4*(4/(6/9)) \n", + "0114: 10+14 0689: 0-((6-9)*8) 1356: 13+(5+6) 2269: 96/(2+2) 3338: 3*(3-(3-8)) 4469: 4*(4/(6/9)) \n", "0122: 0+(12*2) 0699: (90/6)+9 1357: (15-7)*3 2277: 2*(7-(2-7)) 3339: 3*(9-(3/3)) 4477: (4-(4/7))*7 \n", "0123: 0+(1+23) 0788: 80-(7*8) 1358: 1+((3*5)+8) 2278: 2+((2*7)+8) 3344: 3*((3*4)-4) 4478: 4+((4*7)-8) \n", "0124: 0+(1*24) 0789: 0+(7+(8+9)) 1359: 39-15 2279: 22-(7-9) 3345: 33-(4+5) 4479: 4+(4+(7+9)) \n", "0125: 120/5 0888: 0+(8+(8+8)) 1366: 1*((3*6)+6) 2288: 28-(8/2) 3346: 36-(3*4) 4488: 4*(48/8) \n", "0127: 10+(2*7) 1112: (1+1)*12 1367: 61-37 2289: (2*9)-(2-8) 3347: 34-(3+7) 4489: (4*9)-(4+8) \n", - "0128: 0+((1+2)*8) 1113: 11+13 1368: (16-8)*3 2333: 23+(3/3) 3348: (3+3)*(8-4) 4555: 4*(5+(5/5)) \n", + "0128: 0+((1+2)*8) 1113: 11+13 1368: (16-8)*3 2333: 23+(3/3) 3348: (3+3)*(8-4) 4555: 4-(5-(5*5)) \n", "0134: 34-10 1118: (1+(1+1))*8 1369: (13-9)*6 2334: 23-(3-4) 3349: (3+93)/4 4556: 54-(5*6) \n", "0135: 30-(1+5) 1122: 12+12 1377: (1-7)*(3-7) 2335: 25-(3/3) 3355: (5*5)-(3/3) 4557: 4*(7-(5/5)) \n", "0136: (10*3)-6 1123: 1*(1+23) 1378: 3/(1-(7/8)) 2336: 2/(3/36) 3356: 3+((3*5)+6) 4558: (4-(5/5))*8 \n", - "0137: 0+(31-7) 1124: 1/(1/24) 1379: (17-9)*3 2337: 33-(2+7) 3357: 57-33 4559: 49-(5*5) \n", + "0137: 0+(31-7) 1124: 1-(1-24) 1379: (17-9)*3 2337: 33-(2+7) 3357: 57-33 4559: 49-(5*5) \n", "0138: 0+(1*(3*8)) 1125: 1*(25-1) 1388: ((1+3)*8)-8 2338: (2+(3/3))*8 3358: 35-(3+8) 4566: 4*(5+(6/6)) \n", "0139: 0-((1-9)*3) 1126: 26-(1+1) 1389: 18-(3-9) 2339: ((2+3)*3)+9 3359: 39-(3*5) 4567: 5+(76/4) \n", "0144: (10-4)*4 1127: (1+2)*(1+7) 1399: (9-1)/(3/9) 2344: 23+(4/4) 3366: 3*((6/3)+6) 4568: 56-(4*8) \n", @@ -1680,85 +1692,85 @@ "0155: 0-(1-(5*5)) 1135: 35-11 1448: (14-8)*4 2349: 2/(3/(4*9)) 3378: (3*3)+(7+8) 4588: 4*(5+(8/8)) \n", "0156: 0-((1-5)*6) 1136: 31-(1+6) 1449: (1-(4-9))*4 2355: 23+(5/5) 3379: (93/3)-7 4589: 4*(5-(8-9)) \n", "0159: 0+(15+9) 1137: 1*(31-7) 1455: 14+(5+5) 2356: 56-32 3388: 8/(3-(8/3)) 4599: 4*(5+(9/9)) \n", - "0166: (10-6)*6 1138: 1+(31-8) 1456: 65-41 2357: 2+((3*5)+7) 3389: (3*(3+8))-9 4666: 4*(6/(6/6)) \n", - "0168: 0+(16+8) 1139: (11*3)-9 1457: 1+((4*7)-5) 2358: (38/2)+5 3399: 3+(3+(9+9)) 4667: 4*(6/(7-6)) \n", + "0166: (10-6)*6 1138: 1+(31-8) 1456: 65-41 2357: 2+((3*5)+7) 3389: (3*(3+8))-9 4666: 4*(6+(6-6)) \n", + "0168: 0+(16+8) 1139: (11*3)-9 1457: 1+((4*7)-5) 2358: (38/2)+5 3399: 3+(3+(9+9)) 4667: 4*(6*(7-6)) \n", "0177: 0+(17+7) 1144: (1+(1+4))*4 1458: (1+5)*(8-4) 2359: 53-29 3444: ((3+4)*4)-4 4668: 4+(6+(6+8)) \n", "0178: (10-7)*8 1145: (11-5)*4 1459: (15-9)*4 2366: 23+(6/6) 3445: 3+((4*4)+5) 4669: (4*9)-(6+6) \n", - "0222: 0+(2+22) 1146: 1/(1/(4*6)) 1466: 16/(4/6) 2367: 23-(6-7) 3446: 34-(4+6) 4677: 4*(6/(7/7)) \n", - "0224: (0/2)+24 1147: 41-17 1467: (1-(4-7))*6 2368: 62-38 3447: 3*((4/4)+7) 4678: (68/4)+7 \n", + "0222: 0+(2+22) 1146: 1-(1-(4*6)) 1466: 16/(4/6) 2367: 23-(6-7) 3446: 34-(4+6) 4677: 4+(6+(7+7)) \n", + "0224: (0*2)+24 1147: 41-17 1467: (1-(4-7))*6 2368: 62-38 3447: 3*((4/4)+7) 4678: (68/4)+7 \n", "0225: (50-2)/2 1148: 48/(1+1) 1468: (1-(4-6))*8 2369: 2*(6-(3-9)) 3448: 3+(84/4) 4679: 6/(4/(7+9)) \n", "0226: 0-(2-26) 1149: 1+(14+9) 1469: 1/(4/96) 2377: 23+(7/7) 3449: 3*(9-(4/4)) 4688: 88-64 \n", "0228: 20+(8/2) 1155: 1*((5*5)-1) 1477: 71-47 2378: 23-(7-8) 3455: 34-(5+5) 4689: 96/(8-4) \n", - "0233: 30-(2*3) 1156: 1*((5-1)*6) 1478: 1*((7-4)*8) 2379: 27-(9/3) 3456: (54/3)+6 4699: 4*(6/(9/9)) \n", - "0234: (0/3)+24 1157: (5*7)-11 1479: (97-1)/4 2388: 23+(8/8) 3457: 35-(4+7) 4777: 4*(7-(7/7)) \n", + "0233: 30-(2*3) 1156: 1*((5-1)*6) 1478: 1*((7-4)*8) 2379: 27-(9/3) 3456: (54/3)+6 4699: 4*(6+(9-9)) \n", + "0234: (0*3)+24 1157: (5*7)-11 1479: (97-1)/4 2388: 23+(8/8) 3457: 35-(4+7) 4777: 4*(7-(7/7)) \n", "0236: 0+((2+6)*3) 1158: 1+(15+8) 1488: 1*((4*8)-8) 2389: 23-(8-9) 3458: 58-34 4778: 4*(7+(7-8)) \n", "0237: 0+(27-3) 1159: 1*(15+9) 1489: 41-(8+9) 2399: 23+(9/9) 3459: (45/3)+9 4788: 4*(7-(8/8)) \n", - "0238: 0+(32-8) 1166: (1+1)*(6+6) 1499: 19-(4-9) 2444: 24/(4/4) 3466: 36*(4/6) 4789: 98-74 \n", - "0239: (30/2)+9 1167: 1+(16+7) 1555: (5-(1/5))*5 2445: 24/(5-4) 3467: 67-43 4799: 4*(7-(9/9)) \n", + "0238: 0+(32-8) 1166: (1+1)*(6+6) 1499: 19-(4-9) 2444: 24+(4-4) 3466: 36*(4/6) 4789: 98-74 \n", + "0239: (30/2)+9 1167: 1+(16+7) 1555: (5-(1/5))*5 2445: 24*(5-4) 3467: 67-43 4799: 4*(7-(9/9)) \n", "0244: 44-20 1168: 1*(16+8) 1556: ((1+5)*5)-6 2446: 2+((4*4)+6) 3468: 3*(48/6) 4888: (8+88)/4 \n", - "0245: (0/5)+24 1169: 16-(1-9) 1557: 75-51 2447: 42*(4/7) 3469: (3-(6-9))*4 4889: (8*9)-48 \n", - "0246: (0/6)+24 1177: 1*(17+7) 1558: 15/(5/8) 2448: 48-24 3477: 3-((4-7)*7) 4899: (4-(9/9))*8 \n", - "0247: (0/7)+24 1178: 17-(1-8) 1559: (1+5)*(9-5) 2449: (2+94)/4 3478: (4*(7-3))+8 5555: (5*5)-(5/5) \n", - "0248: 0+(28-4) 1188: (11-8)*8 1566: 1*((5*6)-6) 2455: 24/(5/5) 3479: 73-49 5556: 5+((5*5)-6) \n", - "0249: (0/9)+24 1222: 1*(2+22) 1567: 1+((5*6)-7) 2456: 24/(6-5) 3488: 48-(3*8) 5559: 5+(95/5) \n", + "0245: (0*5)+24 1169: 16-(1-9) 1557: 75-51 2447: 42*(4/7) 3469: (3-(6-9))*4 4889: (8*9)-48 \n", + "0246: (0*6)+24 1177: 1*(17+7) 1558: 15/(5/8) 2448: 48-24 3477: 3-((4-7)*7) 4899: (4-(9/9))*8 \n", + "0247: (0*7)+24 1178: 17-(1-8) 1559: (1+5)*(9-5) 2449: (2+94)/4 3478: (4*(7-3))+8 5555: (5*5)-(5/5) \n", + "0248: 0+(28-4) 1188: (11-8)*8 1566: 1*((5*6)-6) 2455: 24+(5-5) 3479: 73-49 5556: 5+((5*5)-6) \n", + "0249: (0*9)+24 1222: 1*(2+22) 1567: 1+((5*6)-7) 2456: 24*(6-5) 3488: 48-(3*8) 5559: 5+(95/5) \n", "0256: 50-26 1223: (13*2)-2 1568: 85-61 2457: 52-(4*7) 3489: 3+(4+(8+9)) 5566: (5*5)-(6/6) \n", "0257: 0+(2*(5+7)) 1224: 12/(2/4) 1569: 96/(5-1) 2458: 2*((4*5)-8) 3499: (99-3)/4 5567: (5*5)+(6-7) \n", "0258: 0-((2-5)*8) 1225: 1-(2-25) 1578: 81-57 2459: 49-25 3556: 35-(5+6) 5568: 5+(5+(6+8)) \n", "0259: 0+(29-5) 1226: 12+(2*6) 1579: 95-71 2466: 66-42 3557: 5+(57/3) 5577: 5+(5+(7+7)) \n", - "0266: (60/2)-6 1227: 27-(1+2) 1588: 1*((8-5)*8) 2467: 24/(7-6) 3558: 3*(5/(5/8)) 5578: 7+(85/5) \n", + "0266: (60/2)-6 1227: 27-(1+2) 1588: 1*((8-5)*8) 2467: 24*(7-6) 3558: 3*(5-(5-8)) 5578: 7+(85/5) \n", "0268: 0+(6/(2/8)) 1228: (2-(1-2))*8 1589: (1-9)*(5-8) 2468: 26-(8/4) 3559: 59-35 5579: 79-55 \n", "0269: 0+((2*9)+6) 1229: (21-9)*2 1599: 1+(5+(9+9)) 2469: (2+(4/6))*9 3566: (3-(5-6))*6 5588: (5*5)-(8/8) \n", - "0288: 0+((2*8)+8) 1233: (1+3)*(2*3) 1666: ((6-1)*6)-6 2477: 24/(7/7) 3567: 3*(56/7) 5589: (5*5)+(8-9) \n", - "0333: 30-(3+3) 1234: 12+(3*4) 1668: 6/(1-(6/8)) 2478: 72-48 3568: 3/((6-5)/8) 5599: (5*5)-(9/9) \n", + "0288: 0+((2*8)+8) 1233: (1+3)*(2*3) 1666: ((6-1)*6)-6 2477: 24+(7-7) 3567: 3*(56/7) 5589: (5*5)+(8-9) \n", + "0333: 30-(3+3) 1234: 12+(3*4) 1668: 6/(1-(6/8)) 2478: 72-48 3568: 3*((6-5)*8) 5599: (5*5)-(9/9) \n", "0334: 0+((3+3)*4) 1235: 12*(5-3) 1669: 16/(6/9) 2479: (2*4)+(7+9) 3569: 3*(5-(6-9)) 5666: (5-(6/6))*6 \n", - "0335: 0+(3*(3+5)) 1236: 36-12 1678: 168/7 2488: 24/(8/8) 3577: 77-53 5667: 5+(6+(6+7)) \n", - "0337: 0+(3+(3*7)) 1237: 1*(27-3) 1679: 91-67 2489: 24/(9-8) 3578: 37-(5+8) 5668: 6-((5-8)*6) \n", - "0338: (0/3)+(3*8) 1238: 1*(32-8) 1688: 18/(6/8) 2499: 24/(9/9) 3579: 3+(5+(7+9)) 5669: (6*9)-(5*6) \n", + "0335: 0+(3*(3+5)) 1236: 36-12 1678: 168/7 2488: 24+(8-8) 3577: 77-53 5667: 5+(6+(6+7)) \n", + "0337: 0+(3+(3*7)) 1237: 1*(27-3) 1679: 91-67 2489: 24*(9-8) 3578: 37-(5+8) 5668: 6-((5-8)*6) \n", + "0338: (0*3)+(3*8) 1238: 1*(32-8) 1688: 18/(6/8) 2499: 24+(9-9) 3579: 3+(5+(7+9)) 5669: (6*9)-(5*6) \n", "0339: 0+(33-9) 1239: 12+(3+9) 1689: 1+(6+(8+9)) 2555: 25-(5/5) 3588: 3+(5+(8+8)) 5677: (5-(7/7))*6 \n", "0344: 0+(3*(4+4)) 1244: (14*2)-4 1699: 1*(6+(9+9)) 2556: 25+(5-6) 3589: 83-59 5678: (5+7)*(8-6) \n", "0345: 54-30 1245: 45-21 1779: 1+(7+(7+9)) 2557: (55-7)/2 3599: (3-9)*(5-9) 5679: 6-((5-7)*9) \n", "0346: 4+(60/3) 1246: 12*(6-4) 1788: 1+(7+(8+8)) 2558: (58/2)-5 3666: 36-(6+6) 5688: (5+(6-8))*8 \n", - "0348: (0/4)+(3*8) 1247: 1+(27-4) 1789: 1*(7+(8+9)) 2559: (2*5)+(5+9) 3667: 3*((6/6)+7) 5689: 89-65 \n", - "0349: 0-((3-9)*4) 1248: 42-18 1799: 7-(1-(9+9)) 2566: 25-(6/6) 3668: 3*(6/(6/8)) 5699: 69-(5*9) \n", - "0358: (0/5)+(3*8) 1249: 1+(92/4) 1888: 1*(8+(8+8)) 2567: 76-52 3669: 36*(6/9) 5779: (5+7)*(9-7) \n", + "0348: (0*4)+(3*8) 1247: 1+(27-4) 1789: 1*(7+(8+9)) 2559: (2*5)+(5+9) 3667: 3*((6/6)+7) 5689: 89-65 \n", + "0349: 0-((3-9)*4) 1248: 42-18 1799: 7-(1-(9+9)) 2566: 25-(6/6) 3668: 3*(6-(6-8)) 5699: 69-(5*9) \n", + "0358: (0*5)+(3*8) 1249: 1+(92/4) 1888: 1*(8+(8+8)) 2567: 76-52 3669: 36*(6/9) 5779: (5+7)*(9-7) \n", "0359: 0+((3*5)+9) 1255: 1-(2-(5*5)) 1889: 8-(1-(8+9)) 2568: (56-8)/2 3677: 37-(6+7) 5788: ((7-5)*8)+8 \n", "0366: 60-36 1256: (15*2)-6 2223: (2/2)+23 2569: (5/(2/6))+9 3678: 87-63 5789: (5+(7-9))*8 \n", - "0367: 0-((3-7)*6) 1257: 51-27 2224: 2/(2/24) 2577: 25-(7/7) 3679: 96/(7-3) 5799: 99-75 \n", + "0367: 0-((3-7)*6) 1257: 51-27 2224: 2-(2-24) 2577: 25-(7/7) 3679: 96/(7-3) 5799: 99-75 \n", "0368: 0-((3-6)*8) 1258: 1+(28-5) 2225: 25-(2/2) 2578: 25+(7-8) 3688: 38-(6+8) 5888: (5*8)-(8+8) \n", "0369: (6*9)-30 1259: 1*(29-5) 2227: 2*((2*7)-2) 2579: (57-9)/2 3689: (96/3)-8 5889: 8/((8-5)/9) \n", - "0378: (0/7)+(3*8) 1266: 12+(6+6) 2228: 28-(2+2) 2588: 82-58 3699: 93-69 6666: 6+(6+(6+6)) \n", + "0378: (0*7)+(3*8) 1266: 12+(6+6) 2228: 28-(2+2) 2588: 82-58 3699: 93-69 6666: 6+(6+(6+6)) \n", "0388: (80-8)/3 1267: (1+7)/(2/6) 2229: 2+(2*(2+9)) 2589: 25+(8-9) 3777: 73-(7*7) 6667: 66-(6*7) \n", "0389: 0+(8/(3/9)) 1268: 12*(8-6) 2233: 23-(2-3) 2599: 25-(9/9) 3778: 38-(7+7) 6668: 6*(6+(6-8)) \n", - "0444: 40-(4*4) 1269: 216/9 2234: 24/(3-2) 2666: (2*6)+(6+6) 3779: 97-73 6669: 6*(6*(6/9)) \n", + "0444: 40-(4*4) 1269: 216/9 2234: 24*(3-2) 2666: (2*6)+(6+6) 3779: 97-73 6669: 6-(6*(6-9)) \n", "0445: 0+(4+(4*5)) 1277: ((7*7)-1)/2 2235: 22-(3-5) 2667: (6+(6*7))/2 3788: 3*(7+(8/8)) 6679: 6*(6+(7-9)) \n", "0446: 64-40 1278: 21/(7/8) 2236: 22+(6/3) 2668: 86-62 3789: 39-(7+8) 6688: 6/((8-6)/8) \n", "0447: 0-(4-(4*7)) 1279: 12*(9-7) 2237: 2*(2+(3+7)) 2669: (66/2)-9 3799: (7*9)-39 6689: 8+(96/6) \n", - "0448: 4+(80/4) 1288: 18-(2-8) 2238: (32/2)+8 2678: 28*(6/7) 3888: 3*(8/(8/8)) 6789: 78-(6*9) \n", - "0456: (0/5)+(4*6) 1289: 192/8 2239: 29-(2+3) 2679: 96-72 3889: 3*(8/(9-8)) 6799: 6-((7-9)*9) \n", - "0457: 74-50 1333: (1+3)*(3+3) 2244: 2+(44/2) 2688: 2+(6+(8+8)) 3899: 3*(8/(9/9)) 6888: 8-((6-8)*8) \n", - "0466: (0/6)+(4*6) 1334: 31-(3+4) 2245: (52-4)/2 2689: 92-68 3999: (99/3)-9 6889: (8+8)/(6/9) \n", + "0448: 4+(80/4) 1288: 18-(2-8) 2238: (32/2)+8 2678: 28*(6/7) 3888: 3*(8+(8-8)) 6789: 78-(6*9) \n", + "0456: (0*5)+(4*6) 1289: 192/8 2239: 29-(2+3) 2679: 96-72 3889: 3*(8*(9-8)) 6799: 6-((7-9)*9) \n", + "0457: 74-50 1333: (1+3)*(3+3) 2244: 2+(44/2) 2688: 2+(6+(8+8)) 3899: 3*(8+(9-9)) 6888: 8-((6-8)*8) \n", + "0466: (0*6)+(4*6) 1334: 31-(3+4) 2245: (52-4)/2 2689: 92-68 3999: (99/3)-9 6889: (8+8)/(6/9) \n", "0467: 70-46 1335: (13-5)*3 2246: 46-22 2699: (2+(6/9))*9 4444: 4+(4+(4*4)) 6899: 96-(8*9) \n", "0468: 84-60 1336: ((1+6)*3)+3 2247: 2+(2*(4+7)) 2778: 2+(7+(7+8)) 4445: 44-(4*5) 7789: 87-(7*9) \n", - "0469: 0+(96/4) 1337: 37-13 2248: 22+(8/4) 2788: (2-(7-8))*8 4446: 4*(4/(4/6)) 7889: 8-((7-9)*8) \n", + "0469: 0+(96/4) 1337: 37-13 2248: 22+(8/4) 2788: (2-(7-8))*8 4446: 4*(4-(4-6)) 7889: 8-((7-9)*8) \n", "0478: 0-((4-7)*8) 1338: 13+(3+8) 2249: 42-(2*9) 2789: 27*(8/9) 4447: (4+4)*(7-4) 8888: 88-(8*8) \n", - "0479: 94-70 1339: 1*(33-9) 2255: 2*(2+(5+5)) 2888: (2+(8/8))*8 4448: (4-(4/4))*8 \n", + "0479: 94-70 1339: 1*(33-9) 2255: 2*(2+(5+5)) 2888: (2*(8+8))-8 4448: (4*(4+4))-8 \n", "0488: 40-(8+8) 1344: 1*(3*(4+4)) 2256: 2+(2*(5+6)) 2889: (2-(8-9))*8 4449: 4-(4*(4-9)) \n", "0566: 0+((5*6)-6) 1345: 1+(3+(4*5)) 2257: 22-(5-7) 2899: (2+(9/9))*8 4455: (4+(4/5))*5 \n", - "0568: 80-56 1346: (14-6)*3 2258: 52-28 3333: 33-(3*3) 4456: 4/((5-4)/6) \n", + "0568: 80-56 1346: (14-6)*3 2258: 52-28 3333: 33-(3*3) 4456: 4*((5-4)*6) \n", "\n", "178 out of 179 distinct license plates (99.4%) can be solved with ops='+-*/^√!,':\n", "\n", - "0000: (0!+(0!+(0!+0!)))! 0077: (7-√(0!+(0!+7)))! 0449: (0/49)+4! 1778: (81-77)! \n", + "0000: (0!+(0!+(0!+0!)))! 0077: (7-√(0!+(0!+7)))! 0449: (0*49)+4! 1778: (81-77)! \n", "0001: (0!+√(10-0!))! 0078: 0!/√(70/8!) 0455: (54-50)! 1899: 18+(9-√9) \n", "0002: (0!+((0^0)+2))! 0079: ((70^0)+√9)! 0458: (480/5!)! 1999: (19-(9+√9!))! \n", - "0003: 0+((0^0)+3)! 0088: √√(0!+80)*8 0459: (0/59)+4! 2222: 2+(√22^2) \n", + "0003: 0+((0^0)+3)! 0088: √√(0!+80)*8 0459: (0*59)+4! 2222: 2+(√22^2) \n", "0004: 0+(0+(0+4!)) 0089: ((80^0)+√9)! 0477: (74-70)! 2226: (26-22)! \n", - "0005: 0+(5-(0^0))! 0099: ((90^0)+√9)! 0489: (0/89)+4! 2299: 29-(2+√9) \n", + "0005: 0+(5-(0^0))! 0099: ((90^0)+√9)! 0489: (0*89)+4! 2299: 29-(2+√9) \n", "0006: (6-(0!+(0^0)))! 0111: (√(10-1)+1)! 0499: (94-90)! 2677: (76-72)! \n", "0007: ((0!+7)/(0!+0!))! 0112: (0!+1)*12 0555: (5-(55^0))! 2777: (2/(7/(7+7)))! \n", "0008: (0!+√√(0!+80))! 0113: ((1^10)+3)! 0556: ((50/5)-6)! 2779: (7-(27/9))! \n", "0009: 0+((0^0)+√9)! 0115: (10-(1+5))! 0557: (5-(57^0))! 2799: 27-(9/√9) \n", - "0011: (0!+√(10-1))! 0116: (10-6)!/1 0558: (5-(58^0))! 2999: 2*(9+(9/√9)) \n", + "0011: (0!+√(10-1))! 0116: (10-6)!*1 0558: (5-(58^0))! 2999: 2*(9+(9/√9)) \n", "0012: (0!+0!)*12 0117: 0+(11-7)! 0559: (5-(59^0))! 3555: (5!/(35-5))! \n", "0013: (√100-3!)! 0118: √(10-1)*8 0567: (5-(67^0))! 4466: (√64-4)*6 \n", "0014: (40/10)! 0119: ((1^10)+√9)! 0577: (5-(77^0))! 4467: 744-6! \n", @@ -1775,21 +1787,21 @@ "0028: (80/20)! 0189: 0+(18+√9!) 0777: ((0!+7)!/(7!+7!))! 6678: (6-((6+8)/7))! \n", "0029: 0!+(20+√9) 0199: (10-(9-√9))! 0778: √(7!/70)*√8 6699: (66+√9!)/√9 \n", "0033: 0+(30-3!) 0223: (2^0)+23 0779: 7!/(70*√9) 6777: (6-((7+7)/7))! \n", - "0034: (0/30)+4! 0227: 27-(0!+2) 0799: ((79^0)+√9)! 6778: (7-√√(87-6))! \n", + "0034: (0*30)+4! 0227: 27-(0!+2) 0799: ((79^0)+√9)! 6778: (7-√√(87-6))! \n", "0035: 30-(0!+5) 0229: 20-(2-√9!) 0889: (80-8)/√9 6779: (67-(7*9))! \n", "0037: 0!+(30-7) 0235: 23+(5^0) 0899: 8*√√(90-9) 6788: 6!-(87*8) \n", "0039: (3+(90^0))! 0255: 25-(5^0) 0999: (90/√9!)+9 6999: (69+√9)/√9 \n", - "0044: (0/40)+4! 0267: (√(70-6)/2)! 1111: (1+(1+(1+1)))! 7777: ((77/7)-7)! \n", - "0045: (0/50)+4! 0277: ((0!+27)/7)! 1114: (1+11)*√4 7778: (7/((7+7)/8))! \n", - "0047: (0/70)+4! 0278: 0+(28/7)! 1115: (15-11)! 7779: 7+(7+(7+√9)) \n", - "0048: (0/80)+4! 0279: 0+(27-√9) 1116: (11-(1+6))! 7788: (7-√√(88-7))! \n", - "0049: (0/90)+4! 0289: 28-(0!+√9) 1117: 1*(11-7)! 7799: (79-7)/√9 \n", + "0044: (0*40)+4! 0267: (√(70-6)/2)! 1111: (1+(1+(1+1)))! 7777: ((77/7)-7)! \n", + "0045: (0*50)+4! 0277: ((0!+27)/7)! 1114: (1+11)*√4 7778: (7/((7+7)/8))! \n", + "0047: (0*70)+4! 0278: 0+(28/7)! 1115: (15-11)! 7779: 7+(7+(7+√9)) \n", + "0048: (0*80)+4! 0279: 0+(27-√9) 1116: (11-(1+6))! 7788: (7-√√(88-7))! \n", + "0049: (0*90)+4! 0289: 28-(0!+√9) 1117: 1*(11-7)! 7799: (79-7)/√9 \n", "0055: (5-(50^0))! 0299: ((29^0)+√9)! 1119: ((1+11)/√9)! 7888: ((88/8)-7)! \n", "0056: (5-(60^0))! 0336: 30-√36 1179: (1+71)/√9 7899: 78-(9*√9!) \n", - "0057: (5-(70^0))! 0347: (0/37)+4! 1189: (8/(11-9))! 7999: ((99/9)-7)! \n", + "0057: (5-(70^0))! 0347: (0*37)+4! 1189: (8/(11-9))! 7999: ((99/9)-7)! \n", "0058: (5-(80^0))! 0355: (3+(55^0))! 1199: (11*√9)-9 8889: 8*√√(89-8) \n", "0059: (5-(90^0))! 0356: (30/6)!/5 1299: √192*√√9 8899: 8*√(8+(9/9)) \n", - "0066: (0!+0!)*(6+6) 0357: (75/3)-0! 1577: (75-71)! 8999: 8*(9/(9/√9)) \n", + "0066: (0!+0!)*(6+6) 0357: (75/3)-0! 1577: (75-71)! 8999: 8*(9-(9-√9)) \n", "0067: (6-(0!+(7^0)))! 0377: 7!/(30*7) 1667: (6!-716)! 9999: (99/√9)-9 \n", "0068: √(80/(6-0!))! 0379: (3+(79^0))! 1677: (71-67)! \n", "0069: ((60^0)+√9)! 0399: 30-(9-√9) 1777: 17+√(7*7) \n", @@ -1812,7 +1824,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "**Wow**! We got all the plates! And we get 3/4 of them with just the basic operators, and then all but one with the second tier, and the last one (6677) with the decimal point.\n", + "**Wow**! We got all the plates! And we get 3/4 of them with just the basic operators, and then all but one with the second tier, and then the last one (6677) with the decimal point.\n", "\n", "Now for Peter's equation-making game:" ] @@ -1829,138 +1841,138 @@ "\n", "445 out of 715 distinct license plates (62.2%) can be solved with ops='+-*/,':\n", "\n", - "0000: 0=(0+(0+0)) 0156: 0=(1+(5-6)) 0688: 0=(6*(8-8)) 1337: 1=(7-(3+3)) 2388: 2=(3-(8/8)) 4455: 4=(4/(5/5)) \n", - "0001: 0=(0/10) 0166: 0=(1-(6/6)) 0699: 0=(6*(9-9)) 1338: 1=((3*3)-8) 2389: 2=(3+(8-9)) 4456: 4=(4/(6-5)) \n", - "0002: 0=(0/20) 0167: 0=(1+(6-7)) 0777: 0=(7*(7-7)) 1339: 1=(3*(3/9)) 2399: 2=(3-(9/9)) 4466: 4=(4/(6/6)) \n", - "0003: 0=(0/30) 0177: 0=(1-(7/7)) 0778: 0=((7-7)/8) 1346: 1=(3+(4-6)) 2444: 2=((4+4)/4) 4467: 4=(4/(7-6)) \n", - "0004: 0=(0/40) 0178: 0=(1+(7-8)) 0779: 0=((7-7)/9) 1347: 1=((3+4)/7) 2446: 2=(4+(4-6)) 4468: 4=(6-(8/4)) \n", - "0005: 0=(0/50) 0188: 0=(1-(8/8)) 0788: 0=(7*(8-8)) 1348: 1=(3-(8/4)) 2448: 2=(4*(4/8)) 4477: 4=(4/(7/7)) \n", - "0006: 0=(0/60) 0189: 0=(1+(8-9)) 0799: 0=(7*(9-9)) 1349: 1=(4-(9/3)) 2456: 2=((4+6)/5) 4478: 4=(4/(8-7)) \n", - "0007: 0=(0/70) 0199: 0=(1-(9/9)) 0888: 0=(8*(8-8)) 1355: 3=(15/5) 2457: 2=(4+(5-7)) 4479: 4=((7+9)/4) \n", - "0008: 0=(0/80) 0222: 0=(2*(2-2)) 0889: 0=((8-8)/9) 1357: 1=(3+(5-7)) 2467: 2=(6/(7-4)) 4488: 4=(4/(8/8)) \n", - "0009: 0=(0/90) 0223: 0=((2-2)/3) 0899: 0=(8*(9-9)) 1358: 1=((3+5)/8) 2468: 2=(4+(6-8)) 4489: 4=(4/(9-8)) \n", - "0011: 0=(0/11) 0224: 0=(2+(2-4)) 0999: 0=(9*(9-9)) 1359: 1=(9-(3+5)) 2478: 4=(28/7) 4499: 4=(4/(9/9)) \n", - "0012: 0=(0/12) 0225: 0=((2-2)/5) 1111: 1=(1/(1/1)) 1367: 6=(13-7) 2479: 2=(4+(7-9)) 4555: 4=(5-(5/5)) \n", - "0013: 0=(0/13) 0226: 0=((2-2)/6) 1112: 1=((1+1)/2) 1368: 1=(3+(6-8)) 2488: 2=(8/(8-4)) 4556: 4=(5+(5-6)) \n", - "0014: 0=(0/14) 0227: 0=((2-2)/7) 1113: 1=(3-(1+1)) 1369: 1=((3+6)/9) 2555: 2=((5+5)/5) 4559: 5=(45/9) \n", - "0015: 0=(0/15) 0228: 0=((2-2)/8) 1122: 1=(1/(2/2)) 1379: 1=(3+(7-9)) 2558: 2=(5+(5-8)) 4566: 4=(5-(6/6)) \n", - "0016: 0=(0/16) 0229: 0=((2-2)/9) 1123: 1=((1+2)/3) 1446: 4=(16/4) 2567: 2=((5+7)/6) 4567: 4=(5+(6-7)) \n", - "0017: 0=(0/17) 0233: 0=(2*(3-3)) 1124: 1=(4-(1+2)) 1447: 1=(4+(4-7)) 2568: 2=(6/(8-5)) 4569: 6=(54/9) \n", - "0018: 0=(0/18) 0235: 0=(2+(3-5)) 1129: 2=(11-9) 1448: 1=((4+4)/8) 2569: 2=(5+(6-9)) 4577: 4=(5-(7/7)) \n", - "0019: 0=(0/19) 0236: 0=((2*3)-6) 1133: 1=(1/(3/3)) 1449: 1=(9-(4+4)) 2579: 2=((5+9)/7) 4578: 4=(5+(7-8)) \n", - "0022: 0=(0/22) 0244: 0=(2*(4-4)) 1134: 1=((1+3)/4) 1458: 1=(4+(5-8)) 2589: 2=(8/(9-5)) 4588: 4=(5-(8/8)) \n", - "0023: 0=(0/23) 0245: 4=(20/5) 1135: 1=(5-(1+3)) 1459: 1=((4+5)/9) 2666: 2=((6+6)/6) 4589: 4=(5+(8-9)) \n", - "0024: 0=(0/24) 0246: 0=(2+(4-6)) 1136: 1=((6/3)-1) 1468: 6=(14-8) 2669: 2=(6/(9-6)) 4599: 4=(5-(9/9)) \n", - "0025: 0=(0/25) 0248: 0=((2*4)-8) 1138: 3=(11-8) 1469: 1=(4+(6-9)) 2678: 2=((6+8)/7) 4668: 4=(6+(6-8)) \n", - "0026: 0=(0/26) 0255: 0=(2*(5-5)) 1144: 1=(1/(4/4)) 1477: 7=(14-7) 2777: 2=((7+7)/7) 4669: 4=(6*(6/9)) \n", - "0027: 0=(0/27) 0257: 0=(2+(5-7)) 1145: 1=((1+4)/5) 1559: 1=(5+(5-9)) 2789: 2=((7+9)/8) 4679: 4=(6+(7-9)) \n", - "0028: 0=(0/28) 0266: 0=(2*(6-6)) 1146: 1=(6-(1+4)) 1569: 6=(15-9) 2888: 2=((8+8)/8) 4688: 4=(8/(8-6)) \n", - "0029: 0=(0/29) 0268: 0=(2+(6-8)) 1147: 4=(11-7) 1578: 7=(15-8) 2999: 2=((9+9)/9) 4779: 7=(49/7) \n", - "0033: 0=(0/33) 0277: 0=(2*(7-7)) 1148: 1=((8/4)-1) 1679: 7=(16-9) 3333: 3=(3/(3/3)) 4789: 4=(8/(9-7)) \n", - "0034: 0=(0/34) 0279: 0=(2+(7-9)) 1155: 1=(1/(5/5)) 1688: 8=(16-8) 3334: 3=(3/(4-3)) 5555: 5=(5/(5/5)) \n", - "0035: 0=(0/35) 0288: 0=(2*(8-8)) 1156: 1=((1+5)/6) 1789: 8=(17-9) 3336: 3=((3*3)-6) 5556: 5=(5/(6-5)) \n", - "0036: 0=(0/36) 0299: 0=(2*(9-9)) 1157: 1=(7-(1+5)) 1899: 9=(18-9) 3339: 3=(9-(3+3)) 5566: 5=(5/(6/6)) \n", - "0037: 0=(0/37) 0333: 0=(3*(3-3)) 1166: 1=(1/(6/6)) 2222: 2=(2/(2/2)) 3344: 3=(3/(4/4)) 5567: 5=(5/(7-6)) \n", - "0038: 0=(0/38) 0334: 0=((3-3)/4) 1167: 1=((1+6)/7) 2223: 2=(2/(3-2)) 3345: 3=(3/(5-4)) 5577: 5=(5/(7/7)) \n", - "0039: 0=(0/39) 0335: 0=((3-3)/5) 1168: 1=(8-(1+6)) 2226: 2=(6-(2+2)) 3349: 3=((3*4)-9) 5578: 5=(5/(8-7)) \n", - "0044: 0=(0/44) 0336: 0=(3+(3-6)) 1177: 1=(1/(7/7)) 2228: 2=(8/(2+2)) 3355: 3=(3/(5/5)) 5588: 5=(5/(8/8)) \n", - "0045: 0=(0/45) 0337: 0=((3-3)/7) 1178: 1=((1+7)/8) 2233: 2=(2/(3/3)) 3356: 3=(3/(6-5)) 5589: 5=(5/(9-8)) \n", - "0046: 0=(0/46) 0338: 0=((3-3)/8) 1179: 1=(9-(1+7)) 2234: 2=((2*3)-4) 3366: 3=(3/(6/6)) 5599: 5=(5/(9/9)) \n", - "0047: 0=(0/47) 0339: 0=((3-3)/9) 1188: 1=(1/(8/8)) 2237: 2=(7-(2+3)) 3367: 3=(3/(7-6)) 5666: 5=(6-(6/6)) \n", - "0048: 0=(0/48) 0344: 0=(3*(4-4)) 1189: 1=((1+8)/9) 2238: 2=(8-(2*3)) 3369: 3=(6-(9/3)) 5667: 5=(6+(6-7)) \n", - "0049: 0=(0/49) 0347: 0=(3+(4-7)) 1199: 1=(1/(9/9)) 2244: 2=(2/(4/4)) 3377: 3=(3/(7/7)) 5677: 5=(6-(7/7)) \n", - "0055: 0=(0/55) 0355: 0=(3*(5-5)) 1222: 1=(2-(2/2)) 2245: 2=(2/(5-4)) 3378: 3=(3/(8-7)) 5678: 5=(6+(7-8)) \n", - "0056: 0=(0/56) 0356: 5=(30/6) 1223: 1=(2+(2-3)) 2246: 2=((2*4)-6) 3388: 3=(3/(8/8)) 5688: 5=(6-(8/8)) \n", - "0057: 0=(0/57) 0358: 0=(3+(5-8)) 1224: 1=(2*(2/4)) 2248: 2=(8-(2+4)) 3389: 3=(3/(9-8)) 5689: 5=(6+(8-9)) \n", - "0058: 0=(0/58) 0366: 0=(3*(6-6)) 1225: 1=(5-(2+2)) 2255: 2=(2/(5/5)) 3399: 3=(3/(9/9)) 5699: 5=(6-(9/9)) \n", - "0059: 0=(0/59) 0369: 0=(3+(6-9)) 1226: 1=((6/2)-2) 2256: 2=(2/(6-5)) 3444: 3=(4-(4/4)) 5779: 5=(7+(7-9)) \n", - "0066: 0=(0/66) 0377: 0=(3*(7-7)) 1233: 1=(2-(3/3)) 2258: 2=((2*5)-8) 3445: 3=(4+(4-5)) 6666: 6=(6/(6/6)) \n", - "0067: 0=(0/67) 0388: 0=(3*(8-8)) 1234: 1=(2+(3-4)) 2259: 2=(9-(2+5)) 3448: 3=((4+8)/4) 6667: 6=(6/(7-6)) \n", - "0068: 0=(0/68) 0399: 0=(3*(9-9)) 1235: 1=((2+3)/5) 2266: 2=(2/(6/6)) 3455: 3=(4-(5/5)) 6677: 6=(6/(7/7)) \n", - "0069: 0=(0/69) 0444: 0=(4*(4-4)) 1236: 1=(2*(3/6)) 2267: 2=(2/(7-6)) 3456: 3=(4+(5-6)) 6678: 6=(6/(8-7)) \n", - "0077: 0=(0/77) 0445: 0=((4-4)/5) 1237: 1=(7-(2*3)) 2268: 2=(6-(8/2)) 3457: 3=((5+7)/4) 6688: 6=(6/(8/8)) \n", - "0078: 0=(0/78) 0446: 0=((4-4)/6) 1238: 1=((8/2)-3) 2277: 2=(2/(7/7)) 3458: 3=(5-(8/4)) 6689: 6=(6/(9-8)) \n", - "0079: 0=(0/79) 0447: 0=((4-4)/7) 1239: 1=((9/3)-2) 2278: 2=(2/(8-7)) 3466: 3=(4-(6/6)) 6699: 6=(6/(9/9)) \n", - "0088: 0=(0/88) 0448: 0=(4+(4-8)) 1244: 1=(2-(4/4)) 2288: 2=(2/(8/8)) 3467: 3=(4+(6-7)) 6777: 6=(7-(7/7)) \n", - "0089: 0=(0/89) 0449: 0=((4-4)/9) 1245: 1=(2+(4-5)) 2289: 2=(2/(9-8)) 3468: 3=(4*(6/8)) 6778: 6=(7+(7-8)) \n", - "0099: 0=(0/99) 0455: 0=(4*(5-5)) 1246: 1=((2+4)/6) 2299: 2=(2/(9/9)) 3469: 4=(36/9) 6788: 6=(7-(8/8)) \n", - "0111: 0=(1-(1/1)) 0458: 5=(40/8) 1247: 1=((2*4)-7) 2333: 2=(3-(3/3)) 3477: 3=(4-(7/7)) 6789: 6=(7+(8-9)) \n", + "0000: 0=(0+(0+0)) 0156: 0=(1+(5-6)) 0688: 0=(6*(8-8)) 1337: 1=(7-(3+3)) 2388: 2=(3-(8/8)) 4455: 4=(4+(5-5)) \n", + "0001: 0=(0*10) 0166: 0=(1*(6-6)) 0699: 0=(6*(9-9)) 1338: 1=((3*3)-8) 2389: 2=(3+(8-9)) 4456: 4=(4*(6-5)) \n", + "0002: 0=(0*20) 0167: 0=(1+(6-7)) 0777: 0=(7*(7-7)) 1339: 1=(3*(3/9)) 2399: 2=(3-(9/9)) 4466: 4=(4+(6-6)) \n", + "0003: 0=(0*30) 0177: 0=(1*(7-7)) 0778: 0=((7-7)*8) 1346: 1=(3+(4-6)) 2444: 2=((4+4)/4) 4467: 4=(4*(7-6)) \n", + "0004: 0=(0*40) 0178: 0=(1+(7-8)) 0779: 0=((7-7)*9) 1347: 1=((3+4)/7) 2446: 2=(4+(4-6)) 4468: 4=(6-(8/4)) \n", + "0005: 0=(0*50) 0188: 0=(1*(8-8)) 0788: 0=(7*(8-8)) 1348: 1=(3-(8/4)) 2448: 2=(4*(4/8)) 4477: 4=(4+(7-7)) \n", + "0006: 0=(0*60) 0189: 0=(1+(8-9)) 0799: 0=(7*(9-9)) 1349: 1=(4-(9/3)) 2456: 2=((4+6)/5) 4478: 4=(4*(8-7)) \n", + "0007: 0=(0*70) 0199: 0=(1*(9-9)) 0888: 0=(8*(8-8)) 1355: (15/3)=5 2457: 2=(4+(5-7)) 4479: 4=((7+9)/4) \n", + "0008: 0=(0*80) 0222: 0=(2*(2-2)) 0889: 0=((8-8)*9) 1357: 1=(3+(5-7)) 2467: 2=(6/(7-4)) 4488: 4=(4+(8-8)) \n", + "0009: 0=(0*90) 0223: 0=((2-2)*3) 0899: 0=(8*(9-9)) 1358: 1=((3+5)/8) 2468: 2=(4+(6-8)) 4489: 4=(4*(9-8)) \n", + "0011: 0=(0*11) 0224: 0=(2+(2-4)) 0999: 0=(9*(9-9)) 1359: 1=(9-(3+5)) 2478: (28/4)=7 4499: 4=(4+(9-9)) \n", + "0012: 0=(0*12) 0225: 0=((2-2)*5) 1111: 1=(1+(1-1)) 1367: 13=(6+7) 2479: 2=(4+(7-9)) 4555: 4=(5-(5/5)) \n", + "0013: 0=(0*13) 0226: 0=((2-2)*6) 1112: 1=((1+1)/2) 1368: 1=(3+(6-8)) 2488: 2=(8/(8-4)) 4556: 4=(5+(5-6)) \n", + "0014: 0=(0*14) 0227: 0=((2-2)*7) 1113: 1=(3-(1+1)) 1369: 1=((3+6)/9) 2555: 2=((5+5)/5) 4559: 45=(5*9) \n", + "0015: 0=(0*15) 0228: 0=((2-2)*8) 1122: 1=(1+(2-2)) 1379: 1=(3+(7-9)) 2558: 2=(5+(5-8)) 4566: 4=(5-(6/6)) \n", + "0016: 0=(0*16) 0229: 0=((2-2)*9) 1123: 1=((1+2)/3) 1446: (16/4)=4 2567: 2=((5+7)/6) 4567: 4=(5+(6-7)) \n", + "0017: 0=(0*17) 0233: 0=(2*(3-3)) 1124: 1=(4-(1+2)) 1447: 1=(4+(4-7)) 2568: 2=(6/(8-5)) 4569: 54=(6*9) \n", + "0018: 0=(0*18) 0235: 0=(2+(3-5)) 1129: 11=(2+9) 1448: 1=((4+4)/8) 2569: 2=(5+(6-9)) 4577: 4=(5-(7/7)) \n", + "0019: 0=(0*19) 0236: 0=((2*3)-6) 1133: 1=(1+(3-3)) 1449: 1=(9-(4+4)) 2579: 2=((5+9)/7) 4578: 4=(5+(7-8)) \n", + "0022: 0=(0*22) 0244: 0=(2*(4-4)) 1134: 1=((1+3)/4) 1458: 1=(4+(5-8)) 2589: 2=(8/(9-5)) 4588: 4=(5-(8/8)) \n", + "0023: 0=(0*23) 0245: 20=(4*5) 1135: 1=(5-(1+3)) 1459: 1=((4+5)/9) 2666: 2=((6+6)/6) 4589: 4=(5+(8-9)) \n", + "0024: 0=(0*24) 0246: 0=(2+(4-6)) 1136: 1=((6/3)-1) 1468: 14=(6+8) 2669: 2=(6/(9-6)) 4599: 4=(5-(9/9)) \n", + "0025: 0=(0*25) 0248: 0=((2*4)-8) 1138: 11=(3+8) 1469: 1=(4+(6-9)) 2678: 2=((6+8)/7) 4668: 4=(6+(6-8)) \n", + "0026: 0=(0*26) 0255: 0=(2*(5-5)) 1144: 1=(1+(4-4)) 1477: 14=(7+7) 2777: 2=((7+7)/7) 4669: 4=(6*(6/9)) \n", + "0027: 0=(0*27) 0257: 0=(2+(5-7)) 1145: 1=((1+4)/5) 1559: 1=(5+(5-9)) 2789: 2=((7+9)/8) 4679: 4=(6+(7-9)) \n", + "0028: 0=(0*28) 0266: 0=(2*(6-6)) 1146: 1=(6-(1+4)) 1569: 15=(6+9) 2888: 2=((8+8)/8) 4688: 4=(8/(8-6)) \n", + "0029: 0=(0*29) 0268: 0=(2+(6-8)) 1147: 11=(4+7) 1578: 15=(7+8) 2999: 2=((9+9)/9) 4779: (49/7)=7 \n", + "0033: 0=(0*33) 0277: 0=(2*(7-7)) 1148: 1=((8/4)-1) 1679: 16=(7+9) 3333: 3=(3+(3-3)) 4789: 4=(8/(9-7)) \n", + "0034: 0=(0*34) 0279: 0=(2+(7-9)) 1155: 1=(1+(5-5)) 1688: 16=(8+8) 3334: 3=(3*(4-3)) 5555: 5=(5+(5-5)) \n", + "0035: 0=(0*35) 0288: 0=(2*(8-8)) 1156: 1=((1+5)/6) 1789: 17=(8+9) 3336: 3=((3*3)-6) 5556: 5=(5*(6-5)) \n", + "0036: 0=(0*36) 0299: 0=(2*(9-9)) 1157: 1=(7-(1+5)) 1899: 18=(9+9) 3339: 3=(9-(3+3)) 5566: 5=(5+(6-6)) \n", + "0037: 0=(0*37) 0333: 0=(3*(3-3)) 1166: 1=(1+(6-6)) 2222: 2=(2+(2-2)) 3344: 3=(3+(4-4)) 5567: 5=(5*(7-6)) \n", + "0038: 0=(0*38) 0334: 0=((3-3)*4) 1167: 1=((1+6)/7) 2223: 2=(2*(3-2)) 3345: 3=(3*(5-4)) 5577: 5=(5+(7-7)) \n", + "0039: 0=(0*39) 0335: 0=((3-3)*5) 1168: 1=(8-(1+6)) 2226: 2=(6-(2+2)) 3349: 3=((3*4)-9) 5578: 5=(5*(8-7)) \n", + "0044: 0=(0*44) 0336: 0=(3+(3-6)) 1177: 1=(1+(7-7)) 2228: 2=(8/(2+2)) 3355: 3=(3+(5-5)) 5588: 5=(5+(8-8)) \n", + "0045: 0=(0*45) 0337: 0=((3-3)*7) 1178: 1=((1+7)/8) 2233: 2=(2+(3-3)) 3356: 3=(3*(6-5)) 5589: 5=(5*(9-8)) \n", + "0046: 0=(0*46) 0338: 0=((3-3)*8) 1179: 1=(9-(1+7)) 2234: 2=((2*3)-4) 3366: 3=(3+(6-6)) 5599: 5=(5+(9-9)) \n", + "0047: 0=(0*47) 0339: 0=((3-3)*9) 1188: 1=(1+(8-8)) 2237: 2=(7-(2+3)) 3367: 3=(3*(7-6)) 5666: 5=(6-(6/6)) \n", + "0048: 0=(0*48) 0344: 0=(3*(4-4)) 1189: 1=((1+8)/9) 2238: 2=(8-(2*3)) 3369: 3=(6-(9/3)) 5667: 5=(6+(6-7)) \n", + "0049: 0=(0*49) 0347: 0=(3+(4-7)) 1199: 1=(1+(9-9)) 2244: 2=(2+(4-4)) 3377: 3=(3+(7-7)) 5677: 5=(6-(7/7)) \n", + "0055: 0=(0*55) 0355: 0=(3*(5-5)) 1222: 1=(2-(2/2)) 2245: 2=(2*(5-4)) 3378: 3=(3*(8-7)) 5678: 5=(6+(7-8)) \n", + "0056: 0=(0*56) 0356: 30=(5*6) 1223: 1=(2+(2-3)) 2246: 2=((2*4)-6) 3388: 3=(3+(8-8)) 5688: 5=(6-(8/8)) \n", + "0057: 0=(0*57) 0358: 0=(3+(5-8)) 1224: 1=(2*(2/4)) 2248: 2=(8-(2+4)) 3389: 3=(3*(9-8)) 5689: 5=(6+(8-9)) \n", + "0058: 0=(0*58) 0366: 0=(3*(6-6)) 1225: 1=(5-(2+2)) 2255: 2=(2+(5-5)) 3399: 3=(3+(9-9)) 5699: 5=(6-(9/9)) \n", + "0059: 0=(0*59) 0369: 0=(3+(6-9)) 1226: 1=((6/2)-2) 2256: 2=(2*(6-5)) 3444: 3=(4-(4/4)) 5779: 5=(7+(7-9)) \n", + "0066: 0=(0*66) 0377: 0=(3*(7-7)) 1233: 1=(2-(3/3)) 2258: 2=((2*5)-8) 3445: 3=(4+(4-5)) 6666: 6=(6+(6-6)) \n", + "0067: 0=(0*67) 0388: 0=(3*(8-8)) 1234: 1=(2+(3-4)) 2259: 2=(9-(2+5)) 3448: 3=((4+8)/4) 6667: 6=(6*(7-6)) \n", + "0068: 0=(0*68) 0399: 0=(3*(9-9)) 1235: 1=((2+3)/5) 2266: 2=(2+(6-6)) 3455: 3=(4-(5/5)) 6677: 6=(6+(7-7)) \n", + "0069: 0=(0*69) 0444: 0=(4*(4-4)) 1236: 1=(2*(3/6)) 2267: 2=(2*(7-6)) 3456: 3=(4+(5-6)) 6678: 6=(6*(8-7)) \n", + "0077: 0=(0*77) 0445: 0=((4-4)*5) 1237: 1=(7-(2*3)) 2268: 2=(6-(8/2)) 3457: 3=((5+7)/4) 6688: 6=(6+(8-8)) \n", + "0078: 0=(0*78) 0446: 0=((4-4)*6) 1238: 1=((8/2)-3) 2277: 2=(2+(7-7)) 3458: 3=(5-(8/4)) 6689: 6=(6*(9-8)) \n", + "0079: 0=(0*79) 0447: 0=((4-4)*7) 1239: 1=((9/3)-2) 2278: 2=(2*(8-7)) 3466: 3=(4-(6/6)) 6699: 6=(6+(9-9)) \n", + "0088: 0=(0*88) 0448: 0=(4+(4-8)) 1244: 1=(2-(4/4)) 2288: 2=(2+(8-8)) 3467: 3=(4+(6-7)) 6777: 6=(7-(7/7)) \n", + "0089: 0=(0*89) 0449: 0=((4-4)*9) 1245: 1=(2+(4-5)) 2289: 2=(2*(9-8)) 3468: 3=(4*(6/8)) 6778: 6=(7+(7-8)) \n", + "0099: 0=(0*99) 0455: 0=(4*(5-5)) 1246: 1=((2+4)/6) 2299: 2=(2+(9-9)) 3469: (36/4)=9 6788: 6=(7-(8/8)) \n", + "0111: 0=(1*(1-1)) 0458: 40=(5*8) 1247: 1=((2*4)-7) 2333: 2=(3-(3/3)) 3477: 3=(4-(7/7)) 6789: 6=(7+(8-9)) \n", "0112: 0=(1+(1-2)) 0459: 0=(4+(5-9)) 1248: 1=(2*(4/8)) 2334: 2=(3+(3-4)) 3478: 3=(4+(7-8)) 6799: 6=(7-(9/9)) \n", - "0113: 0=((1-1)/3) 0466: 0=(4*(6-6)) 1249: 1=(9-(2*4)) 2337: 2=((3*3)-7) 3479: 3=(9/(7-4)) 7777: 7=(7/(7/7)) \n", - "0114: 0=((1-1)/4) 0477: 0=(4*(7-7)) 1255: 1=(2-(5/5)) 2338: 2=(8-(3+3)) 3488: 3=(4-(8/8)) 7778: 7=(7/(8-7)) \n", - "0115: 0=((1-1)/5) 0488: 0=(4*(8-8)) 1256: 1=(2+(5-6)) 2339: 2=((9-3)/3) 3489: 3=(4+(8-9)) 7788: 7=(7/(8/8)) \n", - "0116: 0=((1-1)/6) 0499: 0=(4*(9-9)) 1257: 1=((2+5)/7) 2344: 2=(3-(4/4)) 3499: 3=(4-(9/9)) 7789: 7=(7/(9-8)) \n", - "0117: 0=((1-1)/7) 0555: 0=(5*(5-5)) 1258: 1=(5-(8/2)) 2345: 2=(3+(4-5)) 3557: 3=(5+(5-7)) 7799: 7=(7/(9/9)) \n", - "0118: 0=((1-1)/8) 0556: 0=((5-5)/6) 1259: 1=((2*5)-9) 2346: 2=(3*(4/6)) 3567: 3=(6/(7-5)) 7888: 7=(8-(8/8)) \n", - "0119: 0=((1-1)/9) 0557: 0=((5-5)/7) 1266: 1=(2-(6/6)) 2348: 3=(24/8) 3568: 3=(5+(6-8)) 7889: 7=(8+(8-9)) \n", - "0122: 0=(1-(2/2)) 0558: 0=((5-5)/8) 1267: 1=(2+(6-7)) 2349: 2=(9-(3+4)) 3569: 3=((6+9)/5) 7899: 7=(8-(9/9)) \n", - "0123: 0=(1+(2-3)) 0559: 0=((5-5)/9) 1268: 1=((2+6)/8) 2355: 2=(3-(5/5)) 3578: 3=((7+8)/5) 8888: 8=(8/(8/8)) \n", - "0125: 2=(10/5) 0566: 0=(5*(6-6)) 1269: 1=(9-(2+6)) 2356: 2=(3+(5-6)) 3579: 3=(5+(7-9)) 8889: 8=(8/(9-8)) \n", - "0128: 2=(10-8) 0577: 0=(5*(7-7)) 1277: 1=(2-(7/7)) 2357: 2=((3+7)/5) 3589: 3=(9/(8-5)) 8899: 8=(8/(9/9)) \n", - "0133: 0=(1-(3/3)) 0588: 0=(5*(8-8)) 1278: 1=(2+(7-8)) 2359: 2=(5-(9/3)) 3666: 6=(36/6) 8999: 8=(9-(9/9)) \n", - "0134: 0=(1+(3-4)) 0599: 0=(5*(9-9)) 1279: 1=((2+7)/9) 2366: 2=(3-(6/6)) 3668: 3=(6/(8-6)) 9999: 9=(9/(9/9)) \n", - "0137: 3=(10-7) 0666: 0=(6*(6-6)) 1288: 1=(2-(8/8)) 2367: 2=(3+(6-7)) 3669: 3=(6+(6-9)) \n", - "0144: 0=(1-(4/4)) 0667: 0=((6-6)/7) 1289: 1=(2+(8-9)) 2369: 2=(3*(6/9)) 3679: 3=(6/(9-7)) \n", - "0145: 0=(1+(4-5)) 0668: 0=((6-6)/8) 1299: 1=(2-(9/9)) 2377: 2=(3-(7/7)) 3699: 3=(9/(9-6)) \n", - "0146: 4=(10-6) 0669: 0=((6-6)/9) 1335: 1=(3+(3-5)) 2378: 2=(3+(7-8)) 4444: 4=(4/(4/4)) \n", - "0155: 0=(1-(5/5)) 0677: 0=(6*(7-7)) 1336: 1=((3+3)/6) 2379: 3=(27/9) 4445: 4=(4/(5-4)) \n", + "0113: 0=((1-1)*3) 0466: 0=(4*(6-6)) 1249: 1=(9-(2*4)) 2337: 2=((3*3)-7) 3479: 3=(9/(7-4)) 7777: 7=(7+(7-7)) \n", + "0114: 0=((1-1)*4) 0477: 0=(4*(7-7)) 1255: 1=(2-(5/5)) 2338: 2=(8-(3+3)) 3488: 3=(4-(8/8)) 7778: 7=(7*(8-7)) \n", + "0115: 0=((1-1)*5) 0488: 0=(4*(8-8)) 1256: 1=(2+(5-6)) 2339: 2=((9-3)/3) 3489: 3=(4+(8-9)) 7788: 7=(7+(8-8)) \n", + "0116: 0=((1-1)*6) 0499: 0=(4*(9-9)) 1257: 1=((2+5)/7) 2344: 2=(3-(4/4)) 3499: 3=(4-(9/9)) 7789: 7=(7*(9-8)) \n", + "0117: 0=((1-1)*7) 0555: 0=(5*(5-5)) 1258: 1=(5-(8/2)) 2345: 2=(3+(4-5)) 3557: 3=(5+(5-7)) 7799: 7=(7+(9-9)) \n", + "0118: 0=((1-1)*8) 0556: 0=((5-5)*6) 1259: 1=((2*5)-9) 2346: 2=(3*(4/6)) 3567: 3=(6/(7-5)) 7888: 7=(8-(8/8)) \n", + "0119: 0=((1-1)*9) 0557: 0=((5-5)*7) 1266: 1=(2-(6/6)) 2348: 32=(4*8) 3568: 3=(5+(6-8)) 7889: 7=(8+(8-9)) \n", + "0122: 0=(1*(2-2)) 0558: 0=((5-5)*8) 1267: 1=(2+(6-7)) 2349: 2=(9-(3+4)) 3569: 3=((6+9)/5) 7899: 7=(8-(9/9)) \n", + "0123: 0=(1+(2-3)) 0559: 0=((5-5)*9) 1268: 1=((2+6)/8) 2355: 2=(3-(5/5)) 3578: 3=((7+8)/5) 8888: 8=(8+(8-8)) \n", + "0125: 10=(2*5) 0566: 0=(5*(6-6)) 1269: 1=(9-(2+6)) 2356: 2=(3+(5-6)) 3579: 3=(5+(7-9)) 8889: 8=(8*(9-8)) \n", + "0128: 10=(2+8) 0577: 0=(5*(7-7)) 1277: 1=(2-(7/7)) 2357: 2=((3+7)/5) 3589: 3=(9/(8-5)) 8899: 8=(8+(9-9)) \n", + "0133: 0=(1*(3-3)) 0588: 0=(5*(8-8)) 1278: 1=(2+(7-8)) 2359: 2=(5-(9/3)) 3666: 36=(6*6) 8999: 8=(9-(9/9)) \n", + "0134: 0=(1+(3-4)) 0599: 0=(5*(9-9)) 1279: 1=((2+7)/9) 2366: 2=(3-(6/6)) 3668: 3=(6/(8-6)) 9999: 9=(9+(9-9)) \n", + "0137: 10=(3+7) 0666: 0=(6*(6-6)) 1288: 1=(2-(8/8)) 2367: 2=(3+(6-7)) 3669: 3=(6+(6-9)) \n", + "0144: 0=(1*(4-4)) 0667: 0=((6-6)*7) 1289: 1=(2+(8-9)) 2369: 2=(3*(6/9)) 3679: 3=(6/(9-7)) \n", + "0145: 0=(1+(4-5)) 0668: 0=((6-6)*8) 1299: 1=(2-(9/9)) 2377: 2=(3-(7/7)) 3699: 3=(9/(9-6)) \n", + "0146: 10=(4+6) 0669: 0=((6-6)*9) 1335: 1=(3+(3-5)) 2378: 2=(3+(7-8)) 4444: 4=(4+(4-4)) \n", + "0155: 0=(1*(5-5)) 0677: 0=(6*(7-7)) 1336: 1=((3+3)/6) 2379: (27/3)=9 4445: 4=(4*(5-4)) \n", "\n", "269 out of 270 distinct license plates (99.6%) can be solved with ops='+-*/^√!,':\n", "\n", - "0124: 0=(1-(2/√4)) 0589: 0=(5-(8-√9)) 1577: 1=(5^(7-7)) 2578: 2=√(5+(7-8)) 4446: 4=(√64-4) \n", + "0124: 0=(1*(2-√4)) 0589: 0=(5-(8-√9)) 1577: 1=(5^(7-7)) 2578: 2=√(5+(7-8)) 4446: 4=(√64-4) \n", "0126: 0=(√√16-2) 0678: 0!=((6-7)^8) 1579: 1=(5-(7-√9)) 2588: 2=(8-(8-5)!) 4447: 4=((4+4!)/7) \n", - "0127: 0!=(1^√27) 0679: 0=((6-√9!)/7) 1588: 1=(5^(8-8)) 2599: 2=(5-(9/√9)) 4448: 4=(√4/(4/8)) \n", - "0129: 0=(1+(2-√9)) 0689: 0=((6-√9!)/8) 1589: 1=((9-8)^5) 2667: 6=(2-(6-7))! 4449: 4=(4/(4-√9)) \n", + "0127: 0!=(1^√27) 0679: 0=((6-√9!)*7) 1588: 1=(5^(8-8)) 2599: 2=(5-(9/√9)) 4448: 4=(√4/(4/8)) \n", + "0129: 0=(1+(2-√9)) 0689: 0=((6-√9!)*8) 1589: 1=((9-8)^5) 2667: (6*(7-2)!)=6! 4449: 4=(4*(4-√9)) \n", "0135: 0=(1-(3!-5)) 0789: 0!=((8-7)^9) 1599: 1=(5^(9-9)) 2668: 2=(8-√(6*6)) 4457: 4=(√4-(5-7)) \n", - "0136: 0=(1-(3!/6)) 1114: 1=(1^√14) 1666: 1=(6^(6-6)) 2677: 6=(2+(7/7))! 4458: 4=((√4^5)/8) \n", + "0136: 0=(1*(3!-6)) 1114: 1=(1^√14) 1666: 1=(6^(6-6)) 2677: √6^2)!=(7!/7 4458: 4=((√4^5)/8) \n", "0138: 0=(3-√√81) 1115: 1=(1^√15) 1667: 1=((6/6)^7) 2679: 2=(6-(7-√9)) 4459: 4=(5-(4-√9)) \n", - "0139: 0=(1-(3/√9)) 1116: 1=(1^√16) 1668: 1=((6/6)^8) 2688: 2=(6-√(8+8)) 4469: 4=(96/4!) \n", + "0139: 0=(1*(3-√9)) 1116: 1=(1^√16) 1668: 1=((6/6)^8) 2688: 2=(6-√(8+8)) 4469: 4=(96/4!) \n", "0147: 0!=(1^√47) 1117: 1=(1^√17) 1669: 1=((6/6)^9) 2689: 2=(√8^(6/9)) 4557: √4=(7-√(5*5)) \n", "0148: 0!=(1^√48) 1118: 1=(1^√18) 1677: 1=(6^(7-7)) 2699: 2=(6/(9/√9)) 4558: 4=√((5!/5)-8) \n", "0149: 0=(1-(4-√9)) 1119: 1=(1^√19) 1678: 1=((6-7)^8) 2778: 2=√(8!/(7!+7!)) 4568: 4=(√(6!/5)-8) \n", "0157: 0!=(1^√57) 1125: 1=(1^√25) 1689: 1=((8-9)^6) 2779: 2=(9-√(7*7)) 4579: 4=((5+7)/√9) \n", "0158: 0!=(1^√58) 1126: 1=(1^√26) 1699: 1=(6^(9-9)) 2788: 2=√√((8!/7!)+8) 4666: √4=((6+6)/6) \n", - "0159: 0=(1+(5-√9!)) 1127: 1=(1^√27) 1777: 1=(7^(7-7)) 2799: 2=(√(9*9)-7) 4667: 6=(4+(6-7))! \n", - "0168: 0=(6-√√81!) 1128: 1=(1^√28) 1778: 1=((7/7)^8) 2889: 2=(√9-(8/8)) 4677: 6=√√(4+77)! \n", - "0169: 0=(1-(6/√9!)) 1137: 1=(1^√37) 1779: 1=((7/7)^9) 2899: 2=(8-(9-√9)) 4678: √4=((6+8)/7) \n", - "0179: 0=(1-(7-√9!)) 1139: 1=(1^√39) 1788: 1=(7^(8-8)) 3335: 3=(3/(3!-5)) 4689: 4=(8^(6/9)) \n", - "0234: 0=(2-(3!-4)) 1149: 1=(1^√49) 1799: 1=(7^(9-9)) 3337: 3=(3/(7-3!)) 4699: 4=√(96/√9!) \n", + "0159: 0=(1+(5-√9!)) 1127: 1=(1^√27) 1777: 1=(7^(7-7)) 2799: 2=(√(9*9)-7) 4667: (6*(7-√4)!)=6! \n", + "0168: 0=(6-√√81!) 1128: 1=(1^√28) 1778: 1=((7/7)^8) 2889: 2=(√9-(8/8)) 4677: √6^√4)!=(7!/7 \n", + "0169: 0=(1*(6-√9!)) 1137: 1=(1^√37) 1779: 1=((7/7)^9) 2899: 2=(8-(9-√9)) 4678: √4=((6+8)/7) \n", + "0179: 0=(1-(7-√9!)) 1139: 1=(1^√39) 1788: 1=(7^(8-8)) 3335: 3=(3*(3!-5)) 4689: 4=(8^(6/9)) \n", + "0234: 0=(2-(3!-4)) 1149: 1=(1^√49) 1799: 1=(7^(9-9)) 3337: 3=(3*(7-3!)) 4699: 4=√(96/√9!) \n", "0237: 0=(2-√(7-3)) 1158: 1=(1^√58) 1888: 1=(8^(8-8)) 3338: 3=√((3/3)+8) 4777: √4=((7+7)/7) \n", "0238: 0=((2^3)-8) 1159: 1=(1^√59) 1889: 1=((8/8)^9) 3346: 3=√(36/4) 4778: 4=(8!/(7!+7!)) \n", "0239: 0=((3^2)-9) 1169: 1=(1^√69) 1999: 1=(9^(9-9)) 3347: 3=(3!+(4-7)) 4788: 4=√((8!/7!)+8) \n", - "0247: 0=((2-√4)/7) 1227: 1=((2/2)^7) 2224: 2=(4!-22) 3348: 3=√√(84-3) 4799: 4=(7-(9/√9)) \n", - "0249: 0=((2-√4)/9) 1228: 1=((2/2)^8) 2225: 2=√(5-(2/2)) 3357: 3=√√(3!+75) 4888: 4=(8-√(8+8)) \n", + "0247: 0=((2-√4)*7) 1227: 1=((2/2)^7) 2224: 2=(4!-22) 3348: 3=√√(84-3) 4799: 4=(7-(9/√9)) \n", + "0249: 0=((2-√4)*9) 1228: 1=((2/2)^8) 2225: 2=√(5-(2/2)) 3357: 3=√√(3!+75) 4888: 4=(8-√(8+8)) \n", "0256: 0=((5-2)!-6) 1229: 1=((2/2)^9) 2227: 2=√√(2+(2*7)) 3358: 3=(3!+(5-8)) 4889: 4=((8/8)+√9) \n", - "0258: 0!=(5-(8/2)) 1333: 1=(3^(3-3)) 2229: 2=(2/(√9-2)) 3359: 3=√√(5!-39) 4899: 4=(9-(8-√9)) \n", + "0258: 0!=(5-(8/2)) 1333: 1=(3^(3-3)) 2229: 2=(2*(√9-2)) 3359: 3=√√(5!-39) 4899: 4=(9-(8-√9)) \n", "0259: 0=(2-(5-√9)) 1334: 1=((3/3)^4) 2235: 2=(√25-3) 3368: 3=(√3^(8-6)) 4999: 4=(√9+(9/9)) \n", "0267: 0=(√(2+7)!-6) 1344: 1=(3^(4-4)) 2236: 2=√(√36-2) 3379: 3=(√3^(9-7)) 5557: 5=(√5^(7-5)) \n", - "0269: 0=(2-(6/√9)) 1345: 1=((4-3)^5) 2239: 2=(2/(3/√9)) 3446: 3=(4!/√64) 5559: 5=√(5!-95) \n", + "0269: 0=(2-(6/√9)) 1345: 1=((4-3)^5) 2239: 2=(2+(3-√9)) 3446: 3=(4!/√64) 5559: 5=√(5!-95) \n", "0278: 0!=(2+(7-8)) 1356: 1=(√36-5) 2247: 2=(√(2+7)!-4) 3447: 3=(7-√(4*4)) 5568: 5=(√5^(8-6)) \n", - "0289: 0=((2^√9)-8) 1366: 1=(√36/6) 2249: 2=√(24/√9!) 3449: 3=(√49-4) 5569: 5=(5/(6/√9!)) \n", + "0289: 0=((2^√9)-8) 1366: 1=(√36/6) 2249: 2=√(24/√9!) 3449: 3=(√49-4) 5569: 5=(5+(6-√9!)) \n", "0345: 0=(3+(√4-5)) 1377: 1=(3^(7-7)) 2257: 2=(7-√25) 3459: 3=√(54/√9!) 5579: 5=√(75/√9) \n", - "0346: 0=((3*√4)-6) 1378: 1=((8-7)^3) 2269: 2=((2^√9)-6) 3555: 3!=(5+(5/5)) 5668: 6=(5+(6-8))! \n", + "0346: 0=((3*√4)-6) 1378: 1=((8-7)^3) 2269: 2=((2^√9)-6) 3555: 3!=(5+(5/5)) 5668: 56=(8!/6!) \n", "0348: 0=(3-(4!/8)) 1388: 1=(3^(8-8)) 2279: 2=(√2^(9-7)) 3556: 3=(6!/(5!+5!)) 5669: 5=(6-(6/√9!)) \n", "0349: 0=((3^√4)-9) 1389: 1=((9-8)^3) 2335: 2=(3-(3!-5)) 3558: 3=(5!/(5*8)) 5679: 5=(7-(6/√9)) \n", - "0357: 0!=(3+(5-7)) 1399: 1=(3^(9-9)) 2336: 2=(√36/3) 3559: 3=(5/(5/√9)) 5777: 7=(√7^(7-5)) \n", - "0359: 0=((3-√9)/5) 1444: 1=(4^(4-4)) 2347: 2=((3^√4)-7) 3566: √3=(√√(5/6!)*6) 5778: 7=√(57-8) \n", - "0367: 0=((3!-6)/7) 1445: 1=((4/4)^5) 2358: 2=(3!/(8-5)) 3577: 3=√(7-(5-7)) 5788: 5=(7-√√(8+8)) \n", - "0368: 0=((3!-6)/8) 1455: 1=(4^(5-5)) 2368: 2=(8-√36) 3588: 3=(√(8*8)-5) 5789: 5=((7+8)/√9) \n", - "0378: 0!=((8-7)^3) 1456: 1=((4-5)^6) 2445: 2=(√4/(5-4)) 3599: 3=((9+√9!)/5) 5799: 5=(9-(7-√9)) \n", - "0379: 0=((3-√9)/7) 1457: 1=((5-4)^7) 2447: 2=((7-4)!-4) 3667: 3!=(6/(7-6)) 5888: 8=√((√8^5)/√8) \n", - "0389: 0=((3-√9)/8) 1466: 1=(4^(6-6)) 2449: 2=(√(4*9)-4) 3677: 3!=(6/(7/7)) 5889: 5=(9-√(8+8)) \n", - "0456: 0=(√(4+5)!-6) 1467: 1=(√64-7) 2455: 2=(√4/(5/5)) 3678: 3=√√(87-6) 5899: 5=(8-(9/√9)) \n", + "0357: 0!=(3+(5-7)) 1399: 1=(3^(9-9)) 2336: 2=(√36/3) 3559: 3=(5-(5-√9)) 5777: (√7^(7-5))=7 \n", + "0359: 0=((3-√9)*5) 1444: 1=(4^(4-4)) 2347: 2=((3^√4)-7) 3566: √3=(√√(5/6!)*6) 5778: √(57+7)=8 \n", + "0367: 0=((3!-6)*7) 1445: 1=((4/4)^5) 2358: 2=(3!/(8-5)) 3577: 3=√(7-(5-7)) 5788: 5=(7-√√(8+8)) \n", + "0368: 0=((3!-6)*8) 1455: 1=(4^(5-5)) 2368: 2=(8-√36) 3588: 3=(√(8*8)-5) 5789: 5=((7+8)/√9) \n", + "0378: 0!=((8-7)^3) 1456: 1=((4-5)^6) 2445: 2=(√4*(5-4)) 3599: 3=((9+√9!)/5) 5799: 5=(9-(7-√9)) \n", + "0379: 0=((3-√9)*7) 1457: 1=((5-4)^7) 2447: 2=((7-4)!-4) 3667: 3!=(6*(7-6)) 5888: √((√8^5)/√8)=8 \n", + "0389: 0=((3-√9)*8) 1466: 1=(4^(6-6)) 2449: 2=(√(4*9)-4) 3677: 3!=(6+(7-7)) 5889: 5=(9-√(8+8)) \n", + "0456: 0=(√(4+5)!-6) 1467: 1=(√64-7) 2455: 2=(√4+(5-5)) 3678: 3=√√(87-6) 5899: 5=(8-(9/√9)) \n", "0457: 0=(√4+(5-7)) 1478: 1=((7-8)^4) 2458: 2=((√4*5)-8) 3688: 3=(6/√√(8+8)) 5999: 5=(√9!-(9/9)) \n", "0467: 0=(6-(7-4)!) 1479: 1=(√49/7) 2459: 2=(√49-5) 3689: 3=(6/(8-√9!)) 6668: 6=(√6^(8-6)) \n", "0468: 0=(√64-8) 1488: 1=(4^(8-8)) 2466: 2=(√64-6) 3777: 3!=(7-(7/7)) 6669: 6=(6+(6-9))! \n", "0469: 0=(√(4*9)-6) 1489: 1=(8-√49) 2469: 2=√(96/4!) 3778: 3=√((7/7)+8) 6679: 6=(√6^(9-7)) \n", - "0478: 0!=((7-8)^4) 1499: 1=(4^(9-9)) 2477: 2=(√4/(7/7)) 3779: 3=(7/(7/√9)) 6779: 6=(7/(7/√9!)) \n", + "0478: 0!=((7-8)^4) 1499: 1=(4^(9-9)) 2477: 2=(√4+(7-7)) 3779: 3=(7-(7-√9)) 6779: 6=(7-(7-√9!)) \n", "0479: 0=(√49-7) 1555: 1=(5^(5-5)) 2489: 2=√√(48/√9) 3788: 3=√√(88-7) 6888: 6=(8-√√(8+8)) \n", "0489: 0=(4!-(8*√9)) 1556: 1=((5/5)^6) 2499: 2=(9-√49) 3789: 3=√√(78+√9) 6889: 6=√√(89-8)! \n", "0567: 0!=((6-5)^7) 1557: 1=((5/5)^7) 2556: 2=√(5+(5-6)) 3799: 3=(√√9^(9-7)) 6899: 6=((9-8)*√9!) \n", "0568: 0=(6-(8-5)!) 1558: 1=((5/5)^8) 2557: 2=(7-√(5*5)) 3888: 3=√(8+(8/8)) 6999: 6=(9-(9/√9)) \n", "0569: 0=(5*(6-√9!)) 1566: 1=(5^(6-6)) 2559: 2=(√9-(5/5)) 3889: 3=√√(89-8) 7779: 7=(√7^(9-7)) \n", "0578: 0!=((8-7)^5) 1567: 1=((6-5)^7) 2566: 2=√(5-(6/6)) 3899: 3=((9-8)*√9) 7999: 7=(√9!+(9/9)) \n", - "0579: 0!=(5-(7-√9)) 1568: 1=((5-6)^8) 2577: 2=(√(7*7)-5) 3999: 3=(9/(9/√9)) \n", + "0579: 0!=(5-(7-√9)) 1568: 1=((5-6)^8) 2577: 2=(√(7*7)-5) 3999: 3=(9-(9-√9)) \n", "\n", "1 out of 1 distinct license plates (100.0%) can be solved with ops='+-*/^√!,.':\n", "\n", @@ -1971,8 +1983,8 @@ "source": [ "def find_equation(numbers, ops) -> str | None:\n", " \"\"\"Find an equation involving these numbers and operators.\"\"\"\n", - " for i in range(1, len(numbers)): # Number of digits on the left hand side\n", - " for nums in permutations(numbers):\n", + " for nums in permutations(numbers):\n", + " for i in range(1, len(numbers)): # Number of digits on the left hand side\n", " Ltable = expressions(nums[:i], ops, permute=True)\n", " Rtable = expressions(nums[i:], ops, permute=True)\n", " for n in Ltable:\n", @@ -1989,7 +2001,39 @@ "source": [ "Again we got the majority of the plates with the basic ops, and all but one (this time 5558) with the extended ops, but got it with the decimal point. (Sometimes the answer is `5=(5!/(5*.8)!)` and sometimes `5=√5^√(5*.8)`.)\n", "\n", - "It was surprising to me that we did so well on both games, even with the basic ops. It was also surprising that we only needed to go up to one digit on the left-hand side of any equation (possibly with a unary operator). But maybe it shouldn't have been surprising. I found \"6/3 = 4/2\" as my equation for \"2346\", but that's really the same equation as \"6 = 3*(4/2)\"." + "It was surprising to me that we did so well on both games, even with the basic ops. It was also surprising that almost all the equations have only one digit on the left-hand side (possibly with a unary operator). But maybe it shouldn't have been surprising. I found \"6/3 = 4/2\" as my equation for \"2346\", but that's really the same equation as \"6 = 3*(4/2)\".\n", + "\n", + "One more question: is **24** really special? How many plates can be made by other numbers?" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0: 706 6: 642 12: 598 18: 559 24: 536 30: 511 36: 520 42: 457 48: 493 54: 454 60: 454 \n", + " 1: 665 7: 640 13: 541 19: 481 25: 462 31: 401 37: 389 43: 344 49: 397 55: 354 61: 319 \n", + " 2: 670 8: 636 14: 568 20: 545 26: 450 32: 466 38: 390 44: 403 50: 392 56: 448 62: 327 \n", + " 3: 637 9: 624 15: 564 21: 504 27: 472 33: 407 39: 402 45: 436 51: 375 57: 351 63: 407 \n", + " 4: 633 10: 622 16: 581 22: 459 28: 488 34: 426 40: 481 46: 375 52: 379 58: 354 64: 406 \n", + " 5: 637 11: 571 17: 509 23: 450 29: 411 35: 452 41: 379 47: 348 53: 326 59: 312 \n" + ] + } + ], + "source": [ + "show_columns([f'{i:3}: {sum(i in expressions(plate, '+-*/,', permute=True) for plate in plates):3} '\n", + " for i in range(65)])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "No, 24 is not special. It does have a lot of factors, and it does make more plates than any number larger than it. But other targets are also easy to make. It shouldn't be surprising that \"0\" is the esiest target: for any plate with a \"0\" digit we can get 0 from \"0*something\", and for any plate with two digits \"d\", we can use \"(d-d)*something\"." ] }, { @@ -2009,7 +2053,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 44, "metadata": { "id": "CoKnbYBxKEBB", "outputId": "dd72b838-7b22-4080-9b29-739585881ce7" @@ -2023,9 +2067,9 @@ "6 = (1+(1+1))!\n", "6 = (2+(2+2))\n", "6 = ((3*3)-3)\n", - "6 = (4+(4/√4))\n", + "6 = (4+(4-√4))\n", "6 = (5+(5/5))\n", - "6 = (6/(6/6))\n", + "6 = (6+(6-6))\n", "6 = (7-(7/7))\n", "6 = (8-√√(8+8))\n", "6 = (9-(9/√9))\n" @@ -2053,7 +2097,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 45, "metadata": { "id": "jbJsFkNZKEBC", "outputId": "fea9ae24-2e75-4a11-8098-162790f91625" @@ -2095,7 +2139,7 @@ " 27: ⌈(4*√44.4)⌉ 87: (√4*44)-⌈.4⌉ 147: ⌊(44^(√4^.4))⌋ 207: ⌈(44^√√4)⌉-4 267: ⌊(4!*(√4!/.44))⌋ \n", " 28: 44-(4*4) 88: 44+44 148: 4+(4!*⌊√44⌋) 208: ⌈(4.4^(4-.4))⌉ 268: ⌊(4!^(4*.44))⌋ \n", " 29: 4!+⌈4.44⌉ 89: ⌈(√4*44.4)⌉ 149: ⌊(.4*(4.4^4))⌋ 209: ⌈(√⌈4.4⌉^√44)⌉ 269: ⌈(4!^(4*.44))⌉ \n", - " 30: ⌈4.44⌉!/4 90: √4*⌈44.4⌉ 150: .4*⌈(4.4^4)⌉ 210: ⌊(44^√(4/√4))⌋ 270: ⌈(4!^(4^√(4/4!)))⌉\n", + " 30: ⌈4.44⌉!/4 90: √4*⌈44.4⌉ 150: .4*⌈(4.4^4)⌉ 210: ⌊(44^√(4-√4))⌋ 270: ⌈(4!^(4^√(4/4!)))⌉\n", " 31: 4!+⌈√44.4⌉ 91: ⌈(444/√4!)⌉ 151: ⌊(4!*√(44-4))⌋ 211: ⌊(√4!*44)⌋-4 271: ⌊((√4!^4.4)/4)⌋ \n", " 32: √4^⌈4.44⌉ 92: 4+(√4*44) 152: (4*44)-4! 212: (4^4)-44 272: 4*(4!+44) \n", " 33: ⌊(4*(4+4.4))⌋ 93: ⌊((4.4^4)/4)⌋ 153: ⌊(4!*(√4+4.4))⌋ 213: ⌊(44.4^√√4)⌋ 273: ⌊(4^(4!^.44))⌋ \n", @@ -2143,12 +2187,12 @@ "\n", "# Even More Fives: Five 5s\n", "\n", - "In the [xkcd forum](http://forums.xkcd.com/viewtopic.php?f=14&t=116813&start=280) they took up the problem of **five 5s** and got all the integers up to 298, using the \"[double factorial function](https://en.wikipedia.org/wiki/Double_factorial)\" and [π function](https://en.wikipedia.org/wiki/Prime-counting_function). We can get up to 171, using just the default operations, but with five digits it does take over a minute to run, whereas all the other puzzles with four or three digits (and without floor and ceiling) took less. I suspect you could go much further using floor and ceiling, but that computation would take even longer, so for now let's stick with our default set of operations:" + "In the [xkcd forum](http://forums.xkcd.com/viewtopic.php?f=14&t=116813&start=280) they took up the problem of **five 5s** and got all the integers up to 298, using the \"[double factorial function](https://en.wikipedia.org/wiki/Double_factorial)\" and [π function](https://en.wikipedia.org/wiki/Prime-counting_function). We can get up to 171, using just the default operations, but with five digits it does take over a minute to run. I suspect you could go much further using floor and ceiling, but that computation would take even longer, so for now let's stick with our default set of operations:" ] }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 46, "metadata": { "id": "4MHPG5L8KEBC", "outputId": "63bffec7-8b22-4bb2-cd44-6fd03f124ccf" @@ -2168,7 +2212,7 @@ " 5: 5.55-.55 48: 5!/(5*(5.5-5)) 91: (5*5)+(5!*.55) 134: (5!/5)+(55/.5) \n", " 6: 5+(55/55) 49: 55-(.5+5.5) 92: 5+(55+(.5^-5)) 135: (5!+555)/5 \n", " 7: ((5+55)/5)-5 50: 55.5-5.5 93: .5+(5!-(5*5.5)) 136: 5+(5!+(55/5)) \n", - " 8: .5*(5+(55/5)) 51: .5-(5-55.5) 94: 5!-((5/5)+(5*5)) 137: 5+(5!/(5/5.5)) \n", + " 8: .5*(5+(55/5)) 51: .5-(5-55.5) 94: 5!-((5*5)+(5/5)) 137: 5+(5!/(5/5.5)) \n", " 9: 5!-(555/5) 52: 55-(.5+(5*.5)) 95: (55/.55)-5 138: .5+(5*(5*5.5)) \n", " 10: 5!-(55+55) 53: 55.5-(5*.5) 96: 5!-√(5+(55/5))! 139: ((.5+5.5)!/5)-5 \n", " 11: 55/(5.5-.5) 54: 55-(5^(5-5)) 97: 5!-(55-(.5^-5)) 140: .5*(5+(5*55)) \n", @@ -2176,8 +2220,8 @@ " 13: (5+(5+55))/5 56: 55+(5^(5-5)) 99: (55-5.5)/.5 142: 5!+(55/(5*.5)) \n", " 14: (5*5)-(55/5) 57: 55+((5+5)/5) 100: (55/.5)-(5+5) 143: 5!+(55-(.5^-5)) \n", " 15: 5+(55/5.5) 58: (5*.5)+55.5 101: (55.5-5)/.5 144: ((55/5)-5)!/5 \n", - " 16: 5+(5.5+5.5) 59: 5-((5/5)-55) 102: 5+(5!+((5-5!)/5)) 145: 5!+(.5*(55-5)) \n", - " 17: 5+((5+55)/5) 60: 5+(√55*√55) 103: 55+(5!/(5*.5)) 146: 5!+((5/5)+(5*5)) \n", + " 16: 5+(5.5+5.5) 59: 5-((5/5)-55) 102: 5+(5!+((5-5!)/5)) 145: 5!-(.5*(5-55)) \n", + " 17: 5+((5+55)/5) 60: 5-(.5-55.5) 103: 55+(5!/(5*.5)) 146: 5!+((5*5)+(5/5)) \n", " 18: 5+((5!-55)/5) 61: 5.5+55.5 104: 5!-(5+(55/5)) 147: 5!-(.5-(5*5.5)) \n", " 19: (5*5)-(.5+5.5) 62: (55-(5!/5))/.5 105: 55-(5-55) 148: .5+(5!+(5*5.5)) \n", " 20: 55/(5*.55) 63: 5.5-(.5*(5-5!)) 106: (555/5)-5 149: 5+((.5+5.5)!/5) \n", @@ -2203,8 +2247,8 @@ " 40: 55-(5+(5+5)) 83: (.5*5!)-((5-5!)/5) 126: 5!+((55/5)-5) 169: 5!+((5*5)+(5!/5)) \n", " 41: 5!-(55+(5!/5)) 84: 5+(55+(5!/5)) 127: (5!/(5/5.5))-5 170: 5!-(√(5*5)-55) \n", " 42: (5+5.5)/(.5*.5) 85: 5+(55+(5*5)) 128: 5!+(5.5+(5*.5)) 171: (5.5/(.5^5))-5 \n", - "CPU times: user 1min 12s, sys: 583 ms, total: 1min 13s\n", - "Wall time: 1min 13s\n" + "CPU times: user 1min 11s, sys: 529 ms, total: 1min 12s\n", + "Wall time: 1min 12s\n" ] } ], @@ -2223,7 +2267,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 47, "metadata": {}, "outputs": [ { @@ -2232,7 +2276,7 @@ "{2: '(1+1)', 1: '(1*1)'}" ] }, - "execution_count": 46, + "execution_count": 47, "metadata": {}, "output_type": "execute_result" } @@ -2250,7 +2294,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 48, "metadata": {}, "outputs": [ { @@ -2269,7 +2313,7 @@ " 12: '((1+1)*((1+1)*(1+(1+1))))'}" ] }, - "execution_count": 47, + "execution_count": 48, "metadata": {}, "output_type": "execute_result" } @@ -2280,7 +2324,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 49, "metadata": {}, "outputs": [], "source": [ @@ -2297,7 +2341,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 50, "metadata": {}, "outputs": [ { @@ -2380,7 +2424,7 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 51, "metadata": {}, "outputs": [], "source": [ @@ -2392,7 +2436,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 52, "metadata": {}, "outputs": [ {