Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4690

Re: Difference table via DifferenceDelta[ ]. Why do I need two Table[ ] calls?

From Peter Pein <petsie@dordos.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Difference table via DifferenceDelta[ ]. Why do I need two Table[ ] calls?
Date 2011-09-01 10:07 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j3nlgm$p31$1@smc.vnet.net> (permalink)

Show all headers | View raw


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@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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Difference table via DifferenceDelta[ ]. Why do I need two Table[ ] calls? Peter Pein <petsie@dordos.net> - 2011-09-01 10:07 +0000

csiph-web