Re: How to pick all terms which have are multiplied with a factor, e.g., 2

*To*: mathgroup at smc.vnet.net*Subject*: [mg35472] Re: How to pick all terms which have are multiplied with a factor, e.g., 2*From*: "Allan Hayes" <hay at haystack.demon.co.uk>*Date*: Sun, 14 Jul 2002 06:19:47 -0400 (EDT)*References*: <agon2r$8fk$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Matthias: 2 a b^2 c^3 + 12 x y a b + 6 d^-1 +8 //. Module[{r},(n_Integer a_. + p_Integer b_.+rr___ )/;((r = GCD[n,p])>1):> r(n/r a + p/r b)+rr] 2*(a*b^2*c^3 + 3/d + 2*(2 + 3*a*b*x*y)) -- Allan --------------------- Allan Hayes Mathematica Training and Consulting Leicester UK www.haystack.demon.co.uk hay at haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565 "Matthias G. Imhof" <mgi at vt.edu> wrote in message news:agon2r$8fk$1 at smc.vnet.net... > I would like to simplify a large symbolic summation. I know that terms which > are multiplied with a common integer factor can ultimately be combined and > simplified. > > As an example: from the sum > > 2 a b^2 c^3 + 13 x y a b + 2 d^-1 > > I would like to pick 2 a b^2 c^3 + 2 d^-1 to combine them; and similarly for > other common integer factors. I suspect that patterns would help, but I did > not manage to devise a correct one. > > Matthias > >