Re: [sage-support] Formula for simple recursive sequences

2014-09-25 Thread Christophe Bal
Maybe a solution would be to use the natural serie sum(k=0 ; n ; u_{k+1} - u_k) associated to one sequence u_k, and then have a tool giving a formula for the serie. There are algorithms for hypergeometric series if I do not say an idiocy. So my question become : can I ask to Sage to give a formula

Re: [sage-support] Formula for simple recursive sequences

2014-09-25 Thread Christophe Bal
This examples gives value for known n, what I'm looking for is a general formula with a symbolic n. For arithmetico-geometrical sequences, my purpose is more pedagogical than practical. 2014-09-25 22:38 GMT+02:00 Jorge Garcia : > Also, geometric and arithmetic sequences need not be generated rec

Re: [sage-support] Formula for simple recursive sequences

2014-09-25 Thread Jorge Garcia
Also, geometric and arithmetic sequences need not be generated recusively. How about using a list comprehesion to find the series for Xeno's Paradox: sum([(1/2)**(n+1) for n in range(5)]) -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubs

Re: [sage-support] Formula for simple recursive sequences

2014-09-25 Thread Jorge Garcia
Do you mean to write a recusive function to genrate a sequence such as fibonacci: def fib(n): if(n==0 or n==1): return 1 else: return f(n-1)+fib(n-2) -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from thi

[sage-support] Formula for simple recursive sequences

2014-09-25 Thread Christophe Bal
Hello. Is it possible to ask to sage to give formulas for simple recursive sequences ? For example, *w_{n+1} = (n+1)/n*w_n + 1/n* with *w_0 = 1* , we have *w_n = 2 n + 1* . More simple example could be arithmetico-geometrical sequences *w_{n+1} = a*w_n + b* . Christophe BAL -- You receive