Re: Puzzle

*To*: mathgroup at smc.vnet.net*Subject*: [mg2289] Re: [mg2258] Puzzle*From*: castelln at uiuc.edu (Carol Castellon)*Date*: Mon, 23 Oct 1995 12:40:21 -0400

>On Thu, 19 Oct 1995 01:32:26 -0400 Will Self wrote: >Here's a nice puzzle. Find the four numbers in the following sequence >which total 100: {6, 44, 30, 15, 24, 12, 33, 23, 18}. It would seem that >there might be a nice way to do this with Mathematica. Any takers? One of my students (17 yrs old) solved it this way: Do[Do[Do[Do[ If[list[[i]]+list[[j]]+list[[k]]+list[[l]]==100, Print[{list[[i]],list[[j]],list[[k]],list[[l]]}]], {i,j+1,9}],{j,k+1,9}],{k,l+1,9}],{l,1,9}] Carol Castellon