Re: Puzzle
- To: mathgroup at smc.vnet.net
- Subject: [mg2280] Re: [mg2258] Puzzle
- From: brucec (Bruce Carpenter)
- Date: Mon, 23 Oct 1995 12:38:46 -0400
>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? > >Will Self >Billings, Montana The easiest way I've found is: In[6]:= {6, 44, 30, 15, 24, 12, 33, 23, 18}/. {a___,b_,c___,d_,e___,f_,g___,h_,i___} /; b + d + f + h == 100 -> {b,d,f,h} Out[6]= {44, 15, 23, 18} Cheers, Bruce Carpenter