Sort:  

Praise the speed of modern computers! Yeah I was stumped too. I know there is probably a clever way, but I was stuck just with "brute force" as well

Yes, it's very simple to compute that in many programming languages (I use Python) or tools (like Mathematica). I'm not even sure if there is an efficient analytical way to do it. I have play around a bit with it, but so far to no avail.