Discussion about this post

User's avatar
Michael Reilly's avatar

I will admit to being a little bit frustrated that my solutions for N > 2 were overlooked somehow. I will roughly rewrite what I submitted, and, of course, remove embarrassing errors and false paths that I submitted privately. I worked collaboratively with another user named SeerSkye, and much of this work was found by him while I was still messing around with slow computer code.

N=3 => 13 * 12 * (11 + 4) * (1/(10 + 5))/(6 + 9)/(8 - (2 - 3 - 7)) = 8,424,000

N=4 => 17 * 16 * 15 * (11 + 9) * (12 + 8)/((1/(13+7) /(14+6)/(10 - (2 - 5 - 4 - 3)) = 13,056,000,000

N=5 => 21 * 20 * 19 * 18 * (17 + 7) * (16 + 9) / ((1 / (15 + 10))/(14 + 11)/(13 + 12)/(8 - (2 - 6 - 5 - 4 - 3)) = 32,319,000,000,000

The general strategy is to recognize that all /s can become *s after the first one, and all -s can become +s after the first one. If we sacrifice the 1 to the /, and the 2 to the -, we can then try to even out all of the products as much as possible. In general, it seems like the best that we can do is:

product(3N+3..4N+1) * ceil(S/(N+1))^(S mod N+1) * floor(S/(N+1))^(N+1-S mod N+1)

where S = sum(3..3N+2) - 2

Which is an upper bound, actually satisfying this upper bound is probably impossible for all N.

However, we have a little bit of tug of war going on here, because the more digits we use in a single expression the worse the expression gets, and this assumes we use all of the minuses in a single term. If instead we allow ourselves to consider also sacrificing the 3, 4, 5, and so on for larger and larger N, we can begin to do better. The first N where this becomes absolutely desirable to do is N=21. So we have to create larger upper bounds.

N=21 (sacrifice 2 only) => 1858561114113223590154513972642442186649575491096420050912878442728057261260800000

N=21 (sacrifice both 2 and 3) => 1861170011681117541222317931520613643629245091916594782109445096734720000000000000

This more general expression is:

```

def poc(upper, lower):

return prod(range(lower, upper+1))

def sac(n, j):

s = sum(range(j+1, 3*n + j+1)) - sum(range(2, j+1))

return poc(4*n + 1, 3*n + j+1) * ceil(s/(n + j - 1))**(s % (n + j - 1)) * floor(s / (n + j - 1))**((n + j - 1) - (s % (n + j - 1)))

```

Where `sac(21, 2)` considers just the 2 case, `sac(21, 3)` also considers the 3 case. Our upper bound then is the maximum over j = 2..n of `sac(n, j)`

Unfortunately, actually finding explicit expressions for N=21 that correspond to this upper bound is not something I was able to do by hand, and I was unable to write a computer program to do so by the time submissions closed.

Expand full comment
David Alpert's avatar

I guess it was too much to hope that someone had devised a general algorithm for finding the best combo of operations for any n

Expand full comment
10 more comments...

No posts