Make problem1 a little more general.

It now solves problem one for the general case of n elements.
Unfortunately, the solutions don't converge, in fact, as you
increase n, the value at T1 goes higher than T5. I'm pretty sure
this is unphysical and wrong!