Coloring a Sum

*To*: mathgroup at smc.vnet.net*Subject*: [mg107001] Coloring a Sum*From*: "Bruce Colletti" <bwcolletti at verizon.net>*Date*: Sun, 31 Jan 2010 05:57:15 -0500 (EST)

Re 7.0.1 under WinXP. Is there simpler code (than that below) for this task: - For numeric list X = {x1,...,xN}, color and display the form x1 + ... + xN - To color, first split X into m-element sublists - Color red (blue) the elements in odd (even) numbered sublists Thanks. Bruce f[X_List, m_Integer] := Module[{Y}, Y = Partition[X, m]; Z = MapThread[(c = If[OddQ@#2, Red, Blue]; Style[#, c, Bold, 18] & /@ #1) &, {Y, Range@Length@Y}]; Infix[Flatten@Z, Style["+", 18]]]; f[Table[1,{15}],3]