Re: Reciprocal Sums
- To: mathgroup at smc.vnet.net
- Subject: [mg32493] Re: [mg32472] Reciprocal Sums
- From: Rob Pratt <rpratt at email.unc.edu>
- Date: Wed, 23 Jan 2002 01:00:17 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
You don't want to create all the partitions and then select those that work. Instead you might try the idea suggested in the Macalester College Problem of the Week 941 (http://mathforum.org/wagon/fall01/p941.html). The solution gives two pieces of Mathematica code to list (or just count) the partitions whose reciprocal sum is at most 1. From the list, you can extract those partitions with reciprocal sum exactly equal to 1. Perhaps a similar idea can get you the partitions with integer reciprocal sums. Rob Pratt Department of Operations Research The University of North Carolina at Chapel Hill rpratt at email.unc.edu http://www.unc.edu/~rpratt/ On Tue, 22 Jan 2002, Juan wrote: > Hello, > I need your help to resolve this question (I give a example for n=12): > > In[1]:= << DiscreteMath`Combinatorica` > > In[2]:= n = 12; > > In[3]:= p = Partitions[n]; > > > Now, I want to get from p thouse partitions which reciprocal sum is a > integer. > > In[4]:= r = Cases[p, x_ /; IntegerQ[Plus @@ (1/x)]] > > Out[4]:= {{6, 3, 2, 1}, {4, 4, 2, 1, 1}, {3, 3, 3, 1, 1, 1}, {2, 2, 2, 2, 2, > 2}, {2, 2,2, 2, 1, 1, 1, 1}, {2, 2, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, > 1, 1, 1, 1, 1, 1, 1}} > > But, is n is a big number, then you have to wait a big number of seconds to > get r. > > Any suggestion to do that better-faster? > > Best regard > Juan > > > _________________________________________________________________ > Hable con sus amigos en línea, pruebe MSN Messenger: http://messenger.msn.es > > >