Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

combinations problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg130634] combinations problem
  • From: eros olmi <erosolmiz at hotmail.com>
  • Date: Sun, 28 Apr 2013 00:58:19 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net

Hi
i want to select 6 combinations from numbers 1 to 49 with condition that its sum equal 152, the following code works but its timing is 157 seconds on windows xp mathematica v 8. can we make this timing shorter ?
Select[Subsets[Range[49],{6}],Total[#]==152&]


  • Prev by Date: sorting problem
  • Next by Date: Re: Wrong Answer
  • Previous by thread: Re: sorting problem
  • Next by thread: Re: combinations problem