Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #2942 > unrolled thread
| Started by | olfa <olfa.mraihi@yahoo.fr> |
|---|---|
| First post | 2011-06-04 10:19 +0000 |
| Last post | 2011-06-05 11:03 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
fibonacci question olfa <olfa.mraihi@yahoo.fr> - 2011-06-04 10:19 +0000
Re: fibonacci question David Bailey <dave@removedbailey.co.uk> - 2011-06-05 11:03 +0000
| From | olfa <olfa.mraihi@yahoo.fr> |
|---|---|
| Date | 2011-06-04 10:19 +0000 |
| Subject | fibonacci question |
| Message-ID | <isd0r7$1m2$1@smc.vnet.net> |
Hello Mathematica community, why FullSimplify[Fibonacci[cn] + Fibonacci[cn + 1]] is not simplified into Fibonacci[cn+2]? what mathematica function should I use to get this output? thank you very much for your help.
[toc] | [next] | [standalone]
| From | David Bailey <dave@removedbailey.co.uk> |
|---|---|
| Date | 2011-06-05 11:03 +0000 |
| Message-ID | <isfnpl$brr$1@smc.vnet.net> |
| In reply to | #2942 |
On 04/06/2011 11:19, olfa wrote: > Hello Mathematica community, > > why FullSimplify[Fibonacci[cn] + Fibonacci[cn + 1]] is not simplified > into Fibonacci[cn+2]? > what mathematica function should I use to get this output? > > thank you very much for your help. > You cannot expect FullSimplify to use every mathematical fact in every possible way. If are working with Fibonacci, and need this simplification, one way is to use a transformation rule: Fibonacci[cn] + Fibonacci[cn + 1]/.Fibonacci[x_]+Fibonacci[y_]:>Fibonacci[y+1]/;y==x+1 Note that this is a bit more general, in that it will also spot expressions like Fibonacci[cn-1] + Fibonacci[cn]. It doesn't depend on the order in which things are summed, and the sum can contain other terms as well: In[635]:= Fibonacci[cn-1] + cn-1+Fibonacci[cn-2]/.Fibonacci[x_]+Fibonacci[y_]:>Fibonacci[y+1]/;y==x+1 Out[635]= -1 + cn + Fibonacci[cn] David Bailey http://www.dbaileyconsultancy.co.uk
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web