Reformulation We define recursively the energy E(v1 ... vn) of a sequence of integers v1 ... vn as E(v1) = v1 for a sequence of length 1 and as the minimum for i∈1..n of E(v1 ... vi) + E(vi+1 ... vn) + Σ vi otherwise. The problem is to compute the energy of a given sequence v1 ... vn. The dynamic recursive question is almost given in the subject. === q( v1 ... vk) is "what is the energy to build the sequence v1 ... vk" and we have the recursive formula: q( v1 ... vk ) = min_i q( v1 ... vi ) + q(vi+1 ... vk ) === We could also look at the boolean version (not that useful here) q( v1 ... vk) is "is E the energy to build the sequence v1 ... vk" and we have the recursive formula: q( v1 ... vk, E ) = ∃ E1, E2,i such that E1+E2=E and q( v1 ... vi,E1 ) + q(vi+1 ... vk ,E2 ) ==== We need to notice that among all possible arguments to q we will only use sequences of the form L_i ... L_j where L_1 ... L_N is the input sequence. Therefore we can rewrite the dynamic question into q(i,j) = what is the energy E( L_i ... L_{j-1}) ? and see that q(i,j) = Σ_{i≤k