Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2948

Re: fibonacci question

From David Bailey <dave@removedbailey.co.uk>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: fibonacci question
Date 2011-06-05 11:03 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <isfnpl$brr$1@smc.vnet.net> (permalink)
References <isd0r7$1m2$1@smc.vnet.net>

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

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

csiph-web