home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!udel!gatech!swrinde!network.ucsd.edu!galaxy!ucrmath!tadpole
- From: tadpole@ucrmath.ucr.edu (tad white)
- Newsgroups: sci.math
- Subject: Re: Closed forms for sums
- Summary: Mathematica code
- Message-ID: <24833@galaxy.ucr.edu>
- Date: 10 Jan 93 08:47:40 GMT
- References: <964.165.uupcb@hal9k.ann-arbor.mi.us>
- Sender: news@galaxy.ucr.edu
- Organization: University of California, Riverside
- Lines: 64
- Nntp-Posting-Host: ucrmath
-
- In article <964.165.uupcb@hal9k.ann-arbor.mi.us> james.jones@hal9k.ann-arbor.mi.us (James Jones) writes:
- * OB>Subject: sum(i=1 to n, i^3) = ?? URGENT !!
- *
- * While we're on the subject, I was killing some time with Derive, a
- * Mathematical Assistant one day waiting form my Finite class to begin
- * and found the closed form for
- *
- * ---
- * \ j
- * > i
- * /
- * ---
- * i=1
- *
- * where j went from 1 to about 12 or 13. Can't remember exactly where I
- * stopped at.
- [ some formulas included...]
-
- Mathematica doesn't seem to have them built-in either, and I needed
- them for my calculus course last quarter. So here's Mathematica code
- for them, with a sample.
-
- -----
- a[k_, n_] := (a[k,n] = Together [ 1/(k+1) ( (n+1)^(k+1) - 1 -
- Sum[ Binomial[k+1,j] a[j,n], {j,0,k-1}])] ) /; k > 0;
-
- a[0,n] := n;
-
- a::usage = "a[k,n] returns a closed-form expression for 1^k+2^k+...+n^k,
- when n >= 0 (possibly symbolic) and k is a fixed non-negative integer."
- -----
-
- In[2]:= a[3,n]
-
- 2 3 4
- n + 2 n + n
- Out[2]= --------------
- 4
- -----
-
- [ Perhaps some motivation... Look at the integer points in
- the (k+1)-dimensional cube of size n+1. Assign to each point
- the number of distinct values taken by its coordinates. For
- example, if k=1, we have something like this:
-
- 2 2 2 1
- 2 2 1 2
- 2 1 2 2
- 1 2 2 2
-
- Then 1's occur along the (strong) diagonal; 2's occur in a union of
- triangles (exercise: how many?); 3's in a union of tetrahedra, and so
- forth. In this way you write (n+1)^(k+1) as a union of the numbers in
- question, and the recurrence relation falls out.]
-
- Hope this helps. --tad
-
- By the way, I'm not sure there's a standard terminology for these numbers
- (triangular, tetrahedral, ...)? Perhaps "simplicial numbers" is apt?
- --
- /********************************************************\
- * Tad White UCR Dept. of Mathematics *
- * tadpole@ucrmath.ucr.edu Riverside, CA 92521 *
- \********************************************************/
-