Back to the index. Or to the chambers
This article has 25 links. View as Cloud or List.
No pages link here.
Planetmath Browser (2008—2009)
BSD licence | A django site
All articles taken from PlanetMath.org snapshot under CC-BY-SA licence.
→ The original article on PlanetMath.org
Other Formats: LaTeX
Examples Of Simple Recurrence Relation
Many arithmetic functions
can be expressed as recurrence relations, even
in those cases where it would be far more computationally efficient to use a non-recursive formula. For example,
(whether
is an integer
or any other kind of real number) is most easily calculated as
. The recurrence relation for
(with
a positive
integer) is
, with of course
(and if you like,
). The value of these recurrence relations is to illustrate the basic idea of recurrence relations with examples that can be easily verified with only a small effort. Similarly, the
th triangular number
can be obtained from
(again with
, which will be tacitly assumed for the rest of these examples unless otherwise explicitly noted). Another such recurrence relation is that for
, namely
. For
, just multiplying
thrice certainly looks more efficient than the recurrence relation
.
Certain famous sequences, such as the Fibonacci sequence
and the Padovan sequence, are perhaps more easily calculated by their recurrence relations than by a formula. The recurrence relations for these explicitly set
and
(or
and
, depending on taste), and the rest are given by
(that is, add up the previous two terms). So, for the Fibonacci sequence,
, and we can easily verify that the next few terms are 2, 3, 5, 8, 13, 21, 34, 55, 89, etc. Adding up 34 and 55 is certainly quicker than computing
Moving on to a slightly more complicated recurrence relation: that for the Catalan numbers. With
, the later numbers
can calculated by
Lastly, we wish to give two examples where the initial term is not 0 or 1. The Lucas-Lehmer primality test
uses a sequence defined by the recurrence relation
with initial term
. The sequence thus begins: 4, 14, 194, 37634, 1416317954, 2005956546822746114, 4023861667741036022825635656102100994, etc. (see A003010 in Sloane's OEIS). That the sequence has been calculated correctly can be verified by choosing some small Mersenne number
one knows to be either prime
or composite, then seeing if that Mersenne number is divisible
by
. Then there's the Perrin sequence, where not one or two but three initial terms are explicitly defined:
,
,
. The later terms are given by
for
.