This is a program that burte-forces the solution to a riddle I got from a mathoverflow question. The riddle goes like this:
There are 20 soldiers standing distance 1 apart on a bridge of length 19.
At time t=0, the soldiers immediately begin walking left or right with speed 1.
When two soldiers collide, they immediately turn around and begin walking in the opposite direction.
What is longest possible time it takes all the soldiers to leave the bridge?
Annoyingly, I haven't been able to verify if my answer is correct because I've not been able to find it online. If anyone has a more popular version of the riddle or a mathematical solution I'd be VERY interested. You can share it with me by opening an issue on this repo.
Solution
My solution was bridge number 1048574
or > > > > > > > > > > > > > > > > > > > <
, the longest possible time I got was 29.