MathGroup Archive 1994

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

Search the Archive

Alternating Sums

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg340] Alternating Sums
  • From: Xah Y Lee <xyl10060 at fhda.edu>
  • Date: Mon, 19 Dec 1994 07:06:27 -0800 (PST)

This message is supposed to go to Jack Goldberg. I lost his email address.

Subject: Ways to construct alternating sums in mma.

Hi Jack. You may find the following code to construct mylist useful for 
testing purposes.

mylist =
    Table[
            ToExpression@StringJoin["a", ToString[i]], {i,1 , 12 }
    ]

I think the simplist is

 - Sum[ (-1)^i mylist[[i]], {i,1, Length[mylist]} ]

I made a study of all the contributions so far. I am amazed that the one 
using Fold is fastest.

 Xah Lee
 xyl10060 at tiptoe.fhda.edu
 Mountain View, CA.




  • Prev by Date: Better printing on non-postscript printers using a Mac
  • Next by Date: Possible error in $PreRead???
  • Previous by thread: Re: alternating sums
  • Next by thread: Quadra 700 with PowerPC Upgrade