 <pre><code>Def recadd(lis): If lis[0] + lis[1] - lis[2]] = lis[3]: return lis Else: recadd(lis[3] + lis[0:2]) recadd(lis[0] + lis[3] + lis[1:2]) recadd(lis[0:1] + lis[3]. + lis[2]) </code></pre> <p>Quick and dirty hack on my mobile, could be elegantly expanded for k numbers, untested but it should work. </p> <p>Edit: realized this won't work if there is no solution.infinite recursion...</p>