Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: "Alternating" function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63283] Re: [mg63260] "Alternating" function
  • From: Renan <renan.birck at gmail.com>
  • Date: Thu, 22 Dec 2005 00:04:47 -0500 (EST)
  • References: <200512210435.XAA14743@smc.vnet.net> <640A546D-21CE-4DFF-BDD0-9414A8EF775F@jeol.com>
  • Sender: owner-wri-mathgroup at wolfram.com

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