All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 The sum of a sequence (Posted on 2004-12-14)
Find the sum of the sequence: x, 2x2, 3x3, 4x4, 5x5, ... , nxn.

Comments: ( Back to comment list | You must be logged in to post comments.)
 re: Solution | Comment 4 of 10 |
(In reply to Solution by Old Original Oskar!)

The following program evaluates the actual sum, my formula and O.O.O.'s formula for various x and n:

CLS
FOR x = 2 TO 5
FOR n = 2 TO 5
term = x: t = term
FOR termNo = 2 TO n
term = term * x
t = t + termNo * term
NEXT termNo
PRINT x, n, t,
PRINT (1 - (n + 1) * x ^ n + n * x ^ (n + 1)) / (x - 2 + 1 / x),
f = x * (n * x ^ (n + 1) - (n + 1) * x ^ n + 1) / (x - 1) ^ 2
PRINT f
NEXT
PRINT
NEXT

The results agree.  The columns below are x, n, the actual sum, my formula, O.O.O.'s formula:

`2             2             10            10            102             3             34            34            342             4             98            98            982             5             258           258           258`
`3             2             21            21            213             3             102           102           1023             4             426           426           4263             5             1641          1641          1641`
`4             2             36            36            364             3             228           228           2284             4             1252          1252          12524             5             6372          6372          6372`
`5             2             55            55            555             3             430           430           4305             4             2930          2930          29305             5             18555         18555         18555`

 Posted by Charlie on 2004-12-14 18:28:11

 Search: Search body:
Forums (0)