My Discrete Math students today came up with an observation: The
average of any 3 consecutive terms of an arithmetic sequence equals
the middle term.  So, I thought we'd show off some CAS in SAGE (this
class uses python primarily) and wrote the following in my SAGE
notebook:

var('c,d')
term1 = c+(n-1)*d
term2 = c+(n+1)*d
sum = term1+term2
avg = expand(sum/2)
show(term1)
show(term2)
show(sum)
show(avg)

and got the following output
c+(n-1)*d
c+(n+1)*d
2*c+2*n*d
c+n*d

So, I thought we'd try something similar with geometric sequences:
var('c,d')
term1 =a*r**(n-1)
term2 = a*r*(n+1)
prod = term1*term2
avg = simplify(sqrt(prod))
show(term1)
show(term2)
show(sum)
show(avg)

however, I got the following output
a*r**(n-1)
a*r*(n+1)
a**2*r**(2*n)
sqrt(a**2*r**(2*n))

I couldn't get the final result to reduce to a*r**n, is there a way to
do this?

TIA,
A. Jorge Garcia
http://shadowfaxrant.blogspot.com

-- 
You received this message because you are subscribed to the Google Groups 
"sage-edu" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-edu?hl=en.

Reply via email to