Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2003
*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 2003

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

Search the Archive

Re: nth differences

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39869] Re: nth differences
  • From: Bill Rowe <listuser at earthlink.net>
  • Date: Sun, 9 Mar 2003 05:29:02 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

On 3/8/03 at 2:52 AM, _NOzturnerSPAM_ at cyberonic.com (Zachary Turner)
wrote:

>Say I have a list of k integers and I want to produce a list
>containing the first differences?  For example, given {1, 2, 5, 7, 8,
>9} the first differences are {1, 3, 2, 1, 1}, and the second
>differences are {2, -1, -1, 0}, the third are {-3, 0, 1}, etc

ListConvolve[{1,-1},{1, 2, 5, 7, 8, 9}] will compute what you are calling the first difference and

Nest[ListConvolve[{1, -1}, #] &, {1, 2, 5, 7, 8, 9}, n] will compute the nth difference


  • Prev by Date: What is the function doing
  • Next by Date: Re: nth differences
  • Previous by thread: Re: nth differences
  • Next by thread: Re: nth differences