For the classic bridge and torch problem with crossing times {1,…,n}, we derive a closed-form expression for the optimal crossing time T(n) using a recurrence relation derived from the problem's optimal substructure, thus obtaining T(n)=4n2+3n−5+8(−1)n−1
Nearby in the stack
which holds for all
n≥2
. We generalize the problem to a bridge of capacity 3 and obtain the optimal crossing time
T3(n)=6n2+2n−36181+4(−1)n−92cos(32nπ)
which holds for all
n≥7
. As such, we obtain a new sequence A392834 in the On-Line Encyclopedia of Integer Sequences. Lastly, we also explore this problem for star graphs, and see how we can recover some classic identities involving the sum of floor functions.