Re: Simplyfing Sum[Mod[f(k),y],{k,k0,n}] type expressions? (Newbie question)

*To*: mathgroup at smc.vnet.net*Subject*: [mg40224] Re: [mg40202] Simplyfing Sum[Mod[f(k),y],{k,k0,n}] type expressions? (Newbie question)*From*: Dr Bob <drbob at bigfoot.com>*Date*: Wed, 26 Mar 2003 02:43:58 -0500 (EST)*References*: <200303251950.OAA11794@smc.vnet.net>*Reply-to*: drbob at bigfoot.com*Sender*: owner-wri-mathgroup at wolfram.com

You haven't told Mathematica that n and d are integers, so the sum isn't as simple as you pretend. However, the following may help: Simplify[Block[{Sum, rule, assumption = {n, d} â?? Integers}, rule = Sum[Mod[expr_, x_Integer], iter_] :> Mod[Sum[expr, iter], x]; Sum[Mod[3n - k - 4, 3], {k, 2n - 1, d}] /. rule], assumption] Bobby On Tue, 25 Mar 2003 14:50:20 -0500 (EST), prodogoss <prodogoss at btinternet.com> wrote: > I'm dealing with a problem that requires lots of summations of (x mod > y) type expressions. I had hoped that Mathematica (which I've just > started using) could simplify these but it doesn't seem to work. > > E.g., why won't (can't?) Mathematica simplify the expression: > > Sum[Mod[3n-k-4, 3],{k, 2n-1,d}] ? > > > By *hand* I can show that if > > S = SUM((3n-k-4) mod 3, k = 2n-1 to d) and > > G = d - 2n + 2, then S = f(t) where t = (n - 2 - G) mod 3, and > > (f(0), f(1), f(2)) = ({1, 0, 0}, {0, 1, 0}, {0, 0, 1})(G-1, G, G) > > ie 3x1 matrix = (3rd order unit matix) x (3x1 matrix) > > Hence, given values of d & n, S can be expressed in such a way that > its calculation is possible without having to labourously evaluate S > for each step, k. > > > I had heard so much about Mathematica and thought it would excel at > handling problems like this involving summations of Mod[] etc.? Is > there another way of doing this? Any help would be great! > > Thanks in advance! > > -- majort at cox-internet.com Bobby R. Treat

**References**:**Simplyfing Sum[Mod[f(k),y],{k,k0,n}] type expressions? (Newbie question)***From:*prodogoss@btinternet.com (prodogoss)