MathGroup Archive 2005

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

Search the Archive

Re: "Alternating" function


On 12/21/05, Sseziwa Mukasa <mukasa at jeol.com> wrote:

> One way is to use Fold instead of Nest
>
> Fold[x+#2 f[#1]&,x,Table[(-1)^i,{i,0,n-1}]

This does it neatly, and the other solutions also work.

Thanks to Wouter, Dave, Sseziwa, Ingolf and Bob, and all others that I
forgot to mention the name!

:)


  • Prev by Date: Re: Convincing Mathematica that Sqrt[a+b]Sqrt[a-b]==Sqrt[a^2+b^2]
  • Next by Date: Returning an empty sequence
  • Previous by thread: "Alternating" function
  • Next by thread: Re: "Alternating" function