Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

With respect to sequences, look into the Lagrange (interpolation) polynomial for a set points which is here in the documentation. If you type in:

R = PolynomialRing(QQ, 'x')
R.lagrange_polynomial([(1,1),(2,4),(3,9),(4,16),(5,25),(6,36),(7,49)])

You'll get

x^2

There is no correct guess to a sequence, this is just one possible answer. To see this, add another term to the sequence above. For example, add (8,63) to the list of points and Sage will give you the formula:

-1/5040*x^7 + 1/180*x^6 - 23/360*x^5 + 7/18*x^4 - 967/720*x^3 + 649/180*x^2 - 363/140*x + 1

With respect to sequences, look into the Lagrange (interpolation) polynomial for a set points which is here in the documentation. If you type in:

R = PolynomialRing(QQ, 'x')
R.lagrange_polynomial([(1,1),(2,4),(3,9),(4,16),(5,25),(6,36),(7,49)])

You'll get

x^2

There is no correct guess to a sequence, this is just one possible answer. To see this, add another term to the sequence above. For example, add (8,63) to the list of points points

R = PolynomialRing(QQ, 'x')
R.lagrange_polynomial([(1,1),(2,4),(3,9),(4,16),(5,25),(6,36),(7,49),(8,63)])

and Sage will give you the formula:this polynomial:

-1/5040*x^7 + 1/180*x^6 - 23/360*x^5 + 7/18*x^4 - 967/720*x^3 + 649/180*x^2 - 363/140*x + 1

With respect to sequences, look into the Lagrange (interpolation) polynomial for a set points which is here in the documentation. If you type in:

R = PolynomialRing(QQ, 'x')
R.lagrange_polynomial([(1,1),(2,4),(3,9),(4,16),(5,25),(6,36),(7,49)])

You'll get

x^2

There is no correct guess to a sequence, this is just one possible answer. To see this, add another term to the sequence above. For example, add (8,63) to the list of points

R = PolynomialRing(QQ, 'x')
R.lagrange_polynomial([(1,1),(2,4),(3,9),(4,16),(5,25),(6,36),(7,49),(8,63)])

and Sage will give you this polynomial:

-1/5040*x^7 + 1/180*x^6 - 23/360*x^5 + 7/18*x^4 - 967/720*x^3 + 649/180*x^2 - 363/140*x + 1

which is a formula that goes through your 7 points but not (8,64).