Trying to figure out an expression for adding exponents

Click For Summary

Discussion Overview

The discussion revolves around finding an expression for the sum of squares of the first n integers, specifically exploring methods to derive a closed-form formula for this series. Participants are engaged in mathematical reasoning and exploration of different approaches to arrive at a solution.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant seeks an expression to calculate the sum of squares, starting with an example of n=5 and expressing initial attempts with formulas like n^3+n^2(n-1)+n(n-1).
  • Another participant suggests that the goal is to find a closed form for the sum of squares and mentions the relevance of "The Calculus of Finite Differences."
  • It is proposed that the sum of squares can be represented as a cubic function, with a specific formula provided: \sum_{i=1}^n i^2 = \frac{1}{3} n^3 + \frac{1}{2} n^2 + \frac{1}{6} n.
  • Some participants express interest in deriving the formula rather than looking it up, indicating a preference for exploration over straightforward answers.
  • One participant shares a derived formula, n^3-n^2(n-1)+[n(n^2+1)]/2, noting that it simplifies to n^2+[n(n^2+1)]/2 but struggles with accuracy for certain n values.
  • Another participant discusses a method involving generating equations to solve for coefficients in polynomial representations of the series, emphasizing the need for a pattern in values.
  • There is mention of a different approach yielding a formula that only works for a limited range of n, leading to reflections on the challenges of finding a general solution.
  • Participants discuss the coefficients in the polynomial method and how to derive them using linear algebra, with one participant expressing satisfaction with the clarity of the method presented.

Areas of Agreement / Disagreement

Participants generally agree on the goal of finding a closed-form expression for the sum of squares, but multiple competing views and methods remain, with no consensus on a single approach or formula.

Contextual Notes

Some participants express uncertainty about the accuracy of their derived formulas for specific values of n, indicating that the methods discussed may not yield consistent results across all integers.

mesa
Gold Member
Messages
694
Reaction score
36
Basically I am trying to find an expression that can add exponents. Here is an example, let's say we start with n=5, I need something that will calculate 5^2+4^2+3^2+2^2+1^1 by putting in whatever value for n that I choose.

So far I have
n^3+n^2(n-1)+n(n-1)

The end, n(n-1) isn't working quite right. I need to get it to be the same as (n-1) as in the example using n=5 above, or in other words
n(n-1) = 4^2+3^2+2^2+1^2
which it doesn't lol

Looking at it, I am basically running into the same issue again and may need to just start from scratch lol, what do you think?
 
Mathematics news on Phys.org
mesa said:
Basically I am trying to find an expression that can add exponents.

That isn't a good title for what you're doing. You're trying to figure out a closed form formula for the sum of the squares of the first n consecutive integers. I'll assume you're interested in the general method for solving such problems because you could have looked this formula up easily (and someone will probably post the answer). The general topic you should look up is "The Calculus of Finite Differences".
 
The sum of a series of squares will be some cubic function. In this case:

\sum_{i=1}^n i^2 = \frac{1}{3} n^3 + \frac{1}{2} n^2 + \frac{1}{6} n

Link to articles with various methods to solve this:

http://en.wikipedia.org/wiki/Square_pyramidal_number

sum_of_squares.html

For the sum of cubes:

http://en.wikipedia.org/wiki/Cubic_number

One general method for finding the sum of integers to the power p:

\sum_{i=1}^n i^p = c_{p+1} \ n^{p+1} + c_{p} \ n^{p} + c_{p-1} \ n^{p-1} + ... c_{1} \ n
Generate p+1 equations using the numbers 1 to p+1, then use linear algebra to solve for the p+1 coefficients.
 
Last edited:
Stephen Tashi said:
I'll assume you're interested in the general method for solving such problems because you could have looked this formula up easily

That is correct; it's more fun to try to derive it, anyone can use Google lol.

The first part I did is pretty useless really [n^3-n^2(n-1)] because what is left out of the formula will have to start out with the next integer down, basically it's an overly complicated way of stating [n^3-n^2(n-1)] = n^2 but it may still be helpful for the remainder.

Stephen Tashi said:
That isn't a good title for what you're doing. You're trying to figure out a closed form formula for the sum of the squares of the first n consecutive integers.

Hah, yeah your title is better than mine lol.
 
rcgldr said:
The sum of a series of squares will be some cubic function. In this case:

\sum_{i=1}^n i^2 = \frac{1}{3} n^3 + \frac{1}{2} n^2 + \frac{1}{6} n

Link to articles with various methods to solve this:

http://en.wikipedia.org/wiki/Square_pyramidal_number

sum_of_squares.html

Very good information, although I'm more interested in trying to derive it.

Here is the formula as it sat, n^3-n^2(n-1)+[n(n^2+1)]/2
The first part really can be simplified giving n^2+[n(n^2+1)]/2 with the nuts and bolts of it being [n(n^2+1)]/2; so I'm tossing out the beginning but now it's way off.

There is a pattern in the outcomes when plugging in values for n, for example at:

n=1 it works (no surprise)
n=2 it works
n=3 answer off by 1
n=4 " 4
n=5 " 10
n=6 " 20
n=7 " 35
n=8 " 56
n=9 " 84
n=10 " 120

So maybe we just need a formula that will give these values for each integer and tack it on then simplify? This is assuming the first part of the formula will let us do that lol
 
rcgldr said:
One general method for finding the sum of integers to the power p:
\sum_{i=1}^n i^p = c_{p+1} \ n^{p+1} + c_{p} \ n^{p} + c_{p-1} \ n^{p-1} + ... c_{1} \ n
Generate p+1 equations using the numbers 1 to p+1, then use linear algebra to solve for the p+1 coefficients.

mesa said:
Very good information, although I'm more interested in trying to derive it. ... pattern ... formula that will give these values
The general method I mentioned before is how these type of series are usually converted into polynomials. It's essentially using a pattern of values, usually 1 through p+1 to generate the p+1 equations I mentioned before.
 
rcgldr said:
The general method I mentioned before is how these type of series are usually converted into polynomials. It's essentially using a pattern of values, usually 1 through p+1 to generate the p+1 equations I mentioned before.

Oh okay, I'm not familiar with that. What is c? How does p work?

I tried a different method and thought I was doing pretty well and got:

[n^3-3n^2+16n-20]/2

until I realized it only calculated for values 3≤n≤5 lol
Then a familiar pattern re-emerged
n=6 answer was off by 1
n=7 " " " " 5
n=8 " " " " 14
n=9 " " " " 30
n=10 " " " " 55
etc etc etc

In other words this formula is just a complicated way of pushing the same problem I am trying to solve except now it starts at n=6 with the value being n^2+(n-5)^2; pretty funny!

It seems the direction I am going will only continue to push the formula further down for a given n value so it doesn't seem like a good idea to continue in this direction.

I was thinking about doing some hard calculations for n values and look for patterns in percentage differences next and try to derive a formula from that.

Any thoughts?
 
Last edited:
rcgldr said:
The general method I mentioned before is how these type of series are usually converted into polynomials. It's essentially using a pattern of values, usually 1 through p+1 to generate the p+1 equations I mentioned before.

mesa said:
Oh okay, I'm not familiar with that. What is c? How does p work?
c is just a set of coefficients to a polynomial. p is the power of i used in the summation series. There are p+1 terms, so you need to generate p+1 equations, then use linear algebra (or matrices) to solve for the coefficients c.

Using the original post as an example, 12 + 22 + 32 + ... + n2, p = 2, and you need p+1 = 3 equations to determine the coefficients for
c3 n3 + c2 n2 + c1 n, using the values 1 through 3 for n:

c3 13 + c2 12 + c1 1 = 12 = 1
c3 23 + c2 22 + c1 2 = 12 + 22 = 5
c3 33 + c2 32 + c1 3 = 12 + 22 + 32 = 14

01 c3 + 01 c2 + 01 c1 1 = 01
08 c3 + 04 c2 + 02 c1 2 = 05
27 c3 + 09 c2 + 03 c1 3 = 14

then solving for the c's: c3 = 1/3, c2 = 1/2, c1 = 1/6, resuting in (1/3) n3 + (1/2) n2 + (1/6) n.
 
Last edited:
rcgldr said:
c3 13 + c2 12 + c1 1 = 12 = 1
c3 23 + c2 22 + c1 2 = 12 + 22 = 5
c3 33 + c2 32 + c1 3 = 12 + 22 + 32 = 14

01 c3 + 01 c2 + 01 c1 1 = 01
08 c3 + 04 c2 + 02 c1 2 = 05
27 c3 + 09 c2 + 03 c1 3 = 14

then solving for the c's: c3 = 1/3, c2 = 1/2, c1 = 1/6, resuting in (1/3) n3 + (1/2) n2 + (1/6) n.

WOW! This works remarkably well and makes a great deal of sense! My hat goes off to you rcgldr :) I'm also glad to see I was on the right track with n^3!

I see I was getting close using a different approach, although it's similar to this method. I think I will follow it through and see how well it works by comparison when i am done; that is if I can get there lol!
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 3 ·
Replies
3
Views
914
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 35 ·
2
Replies
35
Views
5K