Re: Difference table via DifferenceDelta[ ]. Why do I need two Table[ ] calls?
- To: mathgroup at smc.vnet.net
- Subject: [mg121177] Re: Difference table via DifferenceDelta[ ]. Why do I need two Table[ ] calls?
- From: "Christopher O. Young" <cy56 at comcast.net>
- Date: Sat, 3 Sep 2011 08:03:15 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
Thanks a lot, using Differences[ ] seems like the way to go here; both faster and more concise. On 9/1/11 6:07 AM, in article j3nlgm$p31$1 at smc.vnet.net, "Peter Pein" <petsie at dordos.net> wrote: > Am 31.08.2011 13:41, schrieb Christopher O. Young: >> The following gives me a difference table for x^3, but it would be nice if I >> could do it with only 1 Table call. >> >> Grid[ >> Table[ >> Table[ >> DifferenceDelta[x^3, {x, n}] // Evaluate, >> {x, -6, 6 - n + 1} >> ] >> , {n, 1, 3} >> ], >> Alignment -> Right >> ] >> >> The following hangs up, though. I have to abort it after several minutes of >> nothing happening. >> >> Table[ >> DifferenceDelta[x^3, {x, n}] // Evaluate, >> {x, -6, 6}, >> {n, 1, 3} >> ] >> >> Any help appreciated. >> >> Chris Young >> cy56 at comcast.net >> >> > > Hi Christopher, > > I would use > > In[1]:= Rest@NestList[Differences, Range[-6, 7]^3, 3] > > Out[1]= > {{91, 61, 37, 19, 7, 1, 1, 7, 19, 37, 61, 91, 127}, > {-30, -24, -18, -12, -6, 0, 6, 12, 18, 24, 30, 36}, > {6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6}} > > to get the values. > > Peter >