- Research
- Open access
- Published:

# Closed-form solution of a general three-term recurrence relation

*Advances in Difference Equations*
**volume 2014**, Article number: 196 (2014)

## Abstract

We present a closed-form solution for *n* th term of a general three-term recurrence relation with arbitrary given *n*-dependent coefficients. The derivation and corresponding proof are based on two approaches, which we develop and describe in detail. First, the recursive-sum theory, which gives the exact solution in a compact finite form using a recursive indexing. Second, the discrete dimensional-convolution procedure, which transforms the solution to the non-recursive expression of *n*, including a finite number of elementary operations and functions.

## 1 Introduction

A general three-term recurrence relation is usually defined by the following expression:

where n\ge 1 (n\in \mathbb{N}), {W}_{n} is unknown function of *n*, {A}_{n} and {B}_{n} are arbitrary given functions of *n*, and {W}_{0}={C}_{0}, {W}_{1}={C}_{1} are initial conditions (we assume not to have the trivial case when {C}_{1}={C}_{0}=0 and {W}_{n}\equiv 0).

This well-known relation has a large number of applications and plays an important role in many areas of mathematics and physics. We recall here a few of them to underline the importance of the proposed statement.

First, the recurrence relation Eq. (1) corresponds to the finite difference equation for the general second order differential equation with unknown function f(x) and arbitrary given U(x), namely: {f}^{\u2033}-U(x)\cdot f=0. Therefore, it is widely used for the analytical and numerical analysis (and approximations) in corresponding physical and mathematical applications; see for example [1].

Second, three-term recurrence relations appear naturally when one uses the Frobenius method for solving some linear differential equations and studying some special functions; see [2].

Third, Eq. (1) corresponds to a continued fraction with arbitrary given coefficients. Basically, the three-term recurrence relation corresponds to the expressions for the numerators and denominators of this continued fraction (see Chapter IV in [3]), which were derived by Euler.

In this manuscript we obtain a closed-form solution of a canonical three-term recurrence relation, which is equivalent to Eq. (1) in the case of ({A}_{n}\ne 0, ∀*n*). Our goal is to obtain the solution consisting of a finite number of terms, rather than a variety of methods with infinite series [4]. In that way we develop two approaches for the expressions with a finite number of terms. We start with the recursive-sum theory, which is presented in Section 3. It allows one to obtain the exact solution of the three-term recurrence relation in a compact form using recursive indexing. Next, we develop the discrete dimensional-convolution procedure, which allows one to eliminate recursive indexing and to represent the solution as a closed-form expression. It means that the final closed-form expression depends on arbitrary given coefficients and includes a finite number of elementary operations, such as: ‘+’, ‘−’, ‘×’, ‘÷’; and elementary functions, such as the Heaviside step function (or unit step function) and the floor function for integer division.

## 2 Preliminaries

Let us start from the simplification of Eq. (1). For this we assume that {A}_{n}\ne 0, ∀*n* (in the opposite case, the recurrence relation near numbers of zero *A*-coefficients has other fundamental properties and it should be considered separately). Thus, we can use the following substitution:

According to this substitution and Eq. (1), {a}_{n} fulfills the following three-term recurrence relation:

Since Eq. (1), Eq. (3) are linear and *n*, {A}_{n}, {B}_{n} are arbitrary, we can assume without loss of generality the following initial conditions: {a}_{0}=1, {a}_{1}=1. Finally, we specify {d}_{n}={B}_{n}\cdot {({A}_{n}{A}_{n-1})}^{-1} as an arbitrary given function of *n*, and write below the expression, which we further call the *canonical three*-*term recurrence relation*:

We note that the solution of Eq. (4) consists of a sum of {d}_{i}-products (i\in \mathbb{N}) with different *powers*. Here the product *power* *p* is equal to the total number of {d}_{i} in the product. The maximum power of {a}_{n+1}, *i.e.* the largest power among all the products in {a}_{n+1}, is equal to \u301a(n+1)/2\u301b, since

where we use Gauss notation for the integer division: \u301ax\u301b=\lfloor x\rfloor =max(m\in \mathbb{Z}\mid m\le x). Because of this fundamental characteristic it is natural to express {a}_{n+1}, *i.e.* the solution of Eq. (4), in the following form:

where S(n,p) includes all terms of the *power* *p*. In the next sections we demonstrate that each S(n,p) is equal to the corresponding recursive-sum, and we rigorously prove all the propositions.

## 3 Recursive-sum theory

In this section we start from the definition of a general recursive-sum (R-sum). Next, we present and prove some of its properties, which determine the R-sum algebra. It could be useful for solving different recurrence relations, but, particularly for the solution of the *canonical three*-*term recurrence relation* it is sufficient to use a particular case of the R-sum, namely the reduced R-sum, which is described in the next section.

**Definition 1** A general R-sum (**R**) is defined for the ordered sequence ({d}_{i},i\in \mathbb{Z}) by the following expression:

where (N,k,\mathrm{\Delta},{\mathrm{\Delta}}_{0}\in \mathbb{Z}), {i}_{0}\equiv {\mathrm{\Delta}}_{0}, *N* is the order of the R-sum, k\ge 1 is the power of the R-sum, Δ is the recursive shift of the R-sum, {\mathrm{\Delta}}_{0} is the initial shift of the R-sum. For the correct definition it is also assumed that N\ge {\mathrm{\Delta}}_{0} and {d}_{i} is defined for all indices used in Eq. (7). The product in Eq. (7) corresponds to the standard left-to-right order of multiplication, so the definition can be written also in the following way:

Next, we present some of the elementary properties of the R-sum, P.(1)-P.(3), which follow directly from the definition.

P.(1):

P.(2):

P.(3):

Finally, we consider the *R*-*sum key lemma*: If N\ge {\mathrm{\Delta}}_{0}+1, then

*Proof of the key lemma* First, we consider the difference \mathbf{D}=[\mathbf{R}(N,k+1,\mathrm{\Delta},{\mathrm{\Delta}}_{0})-{d}_{N+(k+1)\mathrm{\Delta}}\cdot \mathbf{R}(N,k,\mathrm{\Delta},{\mathrm{\Delta}}_{0})] and try to eliminate the index numbers which correspond to zero terms in the original expression. For the correct procedure (when an upper bound in each sum is never less than the lower one) we will eliminate the zero terms and delete the corresponding index numbers step by step from {i}_{1} to {i}_{k+1}. We have

At the next step we note that for {i}_{1}=N+\mathrm{\Delta} according to the definition we have only one value, {i}_{2}=N+2\mathrm{\Delta}, and one term, {d}_{N+2\mathrm{\Delta}}, in the second sum in Eq. (13). According to the definition and P.(1) the same is true for the other indices: {i}_{3}=N+3\mathrm{\Delta},\dots ,{i}_{k}=N+k\mathrm{\Delta}. The last term in Eq. (13) gives [{\sum}_{{i}_{k+1}=N+k\mathrm{\Delta}+\mathrm{\Delta}}^{N+(k+1)\mathrm{\Delta}}{d}_{{i}_{k+1}}-{d}_{N+(k+1)\mathrm{\Delta}}]\equiv 0. This means that all the terms in Eq. (13) which correspond to {i}_{1}=N+\mathrm{\Delta} are equal to zero. Since the condition (N\ge {\mathrm{\Delta}}_{0}+1), we can then write

The same procedure can be repeated for any successive indices. Consider the *m* th sum (m\le k) in Eq. (13). For each {i}_{m}=N+m\mathrm{\Delta} we have only one term in the next sum, corresponding to {i}_{m+1}=N+(m+1)\mathrm{\Delta}, and so on until the last term: [{\sum}_{{i}_{k+1}=N+k\mathrm{\Delta}+\mathrm{\Delta}}^{N+(k+1)\mathrm{\Delta}}{d}_{{i}_{k+1}}-{d}_{N+(k+1)\mathrm{\Delta}}]\equiv 0. So we can delete all the corresponding index numbers and write

Finally, we note that [{\sum}_{{i}_{k+1}={i}_{k}+\mathrm{\Delta}}^{N+(k+1)\mathrm{\Delta}}{d}_{{i}_{k+1}}-{d}_{N+(k+1)\mathrm{\Delta}}]={\sum}_{{i}_{k+1}={i}_{k}+\mathrm{\Delta}}^{(N-1)+(k+1)\mathrm{\Delta}}{d}_{{i}_{k+1}}. Thus we obtain

which proves the key lemma. □

## 4 Exact solution of a canonical three-term recurrence relation via finite R-sum expansion

In this section we start with a definition of a reduced R-sum, a particular case of the general R-sum. Then we construct the exact solution of the *canonical three*-*term recurrence relation*, by using the R-sum key lemma.

**Definition 2** A reduced R-sum (\tilde{\mathbf{R}}) is a particular case of the general R-sum (see Eqs. (7)-(8)), defined by the following expression:

The key lemma Eq. (12) gives the following for the reduced R-sum:

Since *N* and *k* are independent and arbitrary, let us consider them as functions of new numbers *n* and *p*: N=N(n,p)=n-2p; k=k(n,p)=p. In that way we consider a new subsidiary function:

According to the previous notations we have N(n,p)=n-2p=n-2k=N(n+2,p+1)=N(n+1,p+1)+1. Thus we can write the analog of the key lemma for the *S* function, by using Eqs. (18) and (19):

Now, we will rigorously prove a theorem about the exact solution of a *canonical three*-*term recurrence relation* Eq. (4).

**Theorem 1** *An exact solution of Eq*. (4) *is the following*:

*Proof* Our proof is based on mathematical induction. Base cases:

Inductive step: we will prove that the statement Eq. (21) for {a}_{n} and {a}_{n-1}, ∀*n*, gives the following:

To prove it for all *n*, we consider below two cases. First case: *n* is an arbitrary even number, n=2m, m\in \mathbb{N}. Second case: *n* is an arbitrary odd number, n=2m+1, m\in \mathbb{N}.

*First case*, n=2m.

Note that {\sum}_{l=1}^{m}S(2m-1,l)=S(2m-1,1)+{\sum}_{l=2}^{m}S(2m-1,l)=S(2m-1,1)+{\sum}_{p=1}^{m-1}S(2m-1,p+1). After the substitution we have

According to Eq. (20) we can write S(2m-1,p+1)+{d}_{2m}\cdot S(2m-2,p)=S(2m,p+1). Also, according to the definitions Eq. (17) and Eq. (19) we can write {d}_{2m}+S(2m-1,1)={d}_{2m}+{\sum}_{j=1}^{2m-1}{d}_{j}={\sum}_{j=1}^{2m}{d}_{j}=S(2m,1). Thus, we can obtain

which proves the first case of the theorem.

*Second case*, n=2m+1.

We have

Similar to the previous case, we write {\sum}_{l=1}^{m}S(2m,l)=S(2m,1)+{\sum}_{p=1}^{m-1}S(2m,p+1). Also we note that {\sum}_{p=1}^{m}S(2m-1,p)={\sum}_{p=1}^{m-1}S(2m-1,p)+S(2m-1,m). Thus, we can write

According to Eq. (20) we again can rewrite S(2m,p+1)+{d}_{2m+1}\cdot S(2m-1,p)=S(2m+1,p+1). In addition we note that {\sum}_{p=1}^{m-1}S(2m+1,p+1)={\sum}_{p=2}^{m}S(2m+1,p). Summarizing, we obtain

Finally, we note that {d}_{2m+1}S(2m-1,m)={d}_{2m+1}\tilde{\mathbf{R}}(-1,m)={d}_{2m+1}{\prod}_{j=1}^{m}{d}_{2j-1}=\tilde{\mathbf{R}}(-1,m+1)=S(2m+1,m+1). In addition, we can write {d}_{2m+1}+S(2m,1)={d}_{2m+1}+{\sum}_{j=1}^{2m}{d}_{j}={\sum}_{j=1}^{2m+1}{d}_{j}=S(2m+1,1). This gives us the final result:

which proves the second case and Theorem 1. □

## 5 Discrete dimensional-convolution procedure

In this section we develop a procedure which could be used for the transformation of the exact solution Eq. (21) to the expression without recursive indexing.

Let us start from a simple case to demonstrate the idea of the discrete dimensional-convolution procedure. We consider a simple expression, which can be associated with a particular case of R-sum:

where {N}_{1},{N}_{2}\in \mathbb{N} ({N}_{1}\le {N}_{2}) are arbitrary given natural numbers; \delta \in \mathbb{N} (0\le \delta \le [{N}_{2}-{N}_{1}]) is an arbitrary given natural number (shift); and f({i}_{1},{i}_{2}) is an arbitrary given function of natural index numbers {i}_{1} and {i}_{2}. The previous expression {E}_{2} can be rewritten as follows:

where F({i}_{1},{i}_{2})=f({i}_{1},{i}_{2})\cdot H({i}_{2}-{i}_{1}-\delta ), and H(x) is Heaviside step function (or unit step function):

Let us consider now Eq. (32). The indices {i}_{1} and {i}_{2} can be associated with two dimensions by the following way. Let us consider a two dimensional plot (array with elements F({i}_{1},{i}_{2})) with horizontal numbering related to the {i}_{2} index and vertical numbering related to the {i}_{1} index;

For numbering of this array of elements it is possible to use a traversal rule with one global index q\in [1,\dots ,{N}_{1}\cdot {N}_{2}] instead of {i}_{1}\in [1,\dots ,{N}_{1}] and {i}_{2}\in [1,\dots ,{N}_{2}]. Consider, for example, the following rule: q={i}_{1}+{N}_{1}\cdot ({i}_{2}-1), with the corresponding relations:^{a} {i}_{1}={i}_{1}(q)=1+{N}_{1}\{(q-1)/{N}_{1}\}=q-{N}_{1}\u301a(q-1)/{N}_{1}\u301b, {i}_{2}={i}_{2}(q)=1+\u301a(q-1)/{N}_{1}\u301b. Since, for the presented rule, a unique combination of ({i}_{1},{i}_{2}) corresponds to a certain unique number *q* and *vice versa* (*i.e.* we have one-to-one mapping), we can rewrite Eq. (32) in the following form:

The presented procedure, *i.e.* the reduction from two dimensions to one dimension, is a particular case of *discrete dimensional*-*convolution procedure*. Let us now generalize it to a multidimensional case. In that way we consider a multidimensional analog of Eq. (32):

where (k\in \mathbb{N}), k\ge 3, is an arbitrary given natural number, ({N}_{1},{N}_{2},\dots ,{N}_{k}\in \mathbb{N}) is an array of arbitrary given natural numbers, and F({i}_{1},{i}_{2},\dots ,{i}_{k}) is an arbitrary given function of {i}_{1},{i}_{2},\dots ,{i}_{k}.

Let us now define a global index *q* as follows:

Note that the minimum value {q}_{\mathrm{min}}=1 corresponds to the case that every index number is equal to unity. The maximum value {q}_{\mathrm{max}}={N}_{1}\cdot {N}_{2}\cdot \phantom{\rule{0.2em}{0ex}}\cdots \phantom{\rule{0.2em}{0ex}}\cdot {N}_{k} corresponds to the case that every index number reaches its maximum, since we have the relation

Now we construct one-to-one mapping between the global index *q* and the index numbers ({i}_{1},\dots ,{i}_{k}). For that we need to solve Eq. (36), *i.e.* to express any certain index number as a function of *q* (not depending on any other index numbers). We do that separately for {i}_{1}, {i}_{k}, and all others, {i}_{r} (2\le r\le [k-1], r\in \mathbb{N}).

*Obtaining of* {i}_{1}: Since ({i}_{1}-1)<{N}_{1}, the expression \{(q-1)/{N}_{1}\} does not depend on any index numbers except {i}_{1}. Thus, we obtain

*Obtaining of* {i}_{k}: Since {i}_{1}+{N}_{1}({i}_{2}-1)+{N}_{1}{N}_{2}({i}_{3}-1)+\cdots +[{\prod}_{j=1}^{k-2}{N}_{j}]({i}_{k-1}-1)-1<[{\prod}_{j=1}^{k-1}{N}_{j}] (see Eq. (36)), the expression \u301a(q-1)/{\prod}_{j=1}^{k-1}{N}_{j}\u301b does not depend on any index numbers except {i}_{k}. Thus we obtain

*Obtaining of* {i}_{r} (2\le r\le [k-1]): Here we make two steps, similar to the previous cases, in order to eliminate the dependence of higher and lower index numbers separately. Consider the following expression:

According to Eq. (37) we have {h}_{r}-1<[{\prod}_{j=1}^{r}{N}_{j}]. In addition, we have the simple relations \{u/v\}\cdot v\equiv u for u<v, and \{u/v\}\cdot v\equiv 0 for (u/v)\in \mathbb{N}. Thus we obtain

Next, we perform a step similar to the one we performed when obtaining {i}_{k} (see also Eq. (39)):

Finally, we can write

As can be seen, Eq. (38) corresponds to Eq. (43) if we put formally r=1. In addition, we can write (q-1)\equiv \{(q-1)/{\prod}_{j=1}^{k}{N}_{j}\}\cdot {\prod}_{j=1}^{k}{N}_{j}. This means that Eq. (39) also corresponds to Eq. (43) if we put formally r=k. Thus we can write the described substitution for the *discrete dimensional*-*convolution procedure* in the following form:

According to the previous equations every certain unique index number combination corresponds to the unique value of *q*. In addition, the total number of different index number combinations is equal to the total number of different values of *q*. Thus, we can conclude that Eq. (44) describes the one-to-one mapping for Eq. (35), and we can write

Summarizing, the proposed procedure allows one to calculate a reduced R-sum without recursive indexing.

## 6 Closed-form solution of the canonical three-term recurrence relation

In this section we apply the previous results, in order to obtain the closed-form solution of Eq. (4) without recursive indexing. By using the exact solution via R-sum expansion Eq. (21), the definition of the reduced R-sum Eq. (17), and the procedure described in the previous section, we can write

where {i}_{0}\equiv -1, {N}_{j}=n-2p+2j (1\le j\le p, j\in \mathbb{N}), and H(x) is the unit step function (see Eq. (33)).

Now, we apply the results from the previous section Eqs. (44)-(45) in order to replace the recursive indexing by one global index *q*. For that we introduce new integer-valued function g=g(m,n,p,q) which is associated with a recursive index {i}_{m} (1\le m\le p, m\in \mathbb{N}):

By using this function and Eqs. (45)-(46) we can obtain finally the closed-form solution^{b}

**Remark** The integer-valued function g(m,n,p,q)\in [1,\dots ,n] determines the index number of arbitrary given {d}_{\text{(index number)}} in the *canonical three*-*term recurrence relation*; see Eq. (4). The first term in the *d*-products in Eq. (48) is {d}_{g(1,n,p,q)} according to Eq. (46) and the corresponding condition {i}_{0}\equiv -1, so for the brevity in our notation we imply: g(0,n,p,q)\equiv -1.

## 7 Fibonacci numbers

An important particular case of the *canonical three*-*term recurrence relation* is the well-known *Fibonacci sequence*, which corresponds to the case {d}_{n}\equiv 1 in Eq. (4). Thus, the *Fibonacci numbers* ({F}_{n}) satisfy the following relation:

The *Fibonacci number* ({F}_{n+1}) corresponds to the total number of terms (*d*-products) in the solution {a}_{n+1} of the *canonical three*-*term recurrence relation* since the exact solution consists of a sum of unique combinations of {d}_{i} products; see Eqs. (4)-(5) and Eqs. (46)-(48).

The closed-form solution of *Fibonacci sequence* has well been known at least since the discovery of Abraham de Moivre, however, we can obtain it also by using our results, namely, Eq. (21) or Eq. (48):

where g(m,n,p,q) and M(n,p) are introduced in Eqs. (47)-(48), and H(x) is the unit step function; see Eq. (33).

This expression gives the exact solution of the *Fibonacci sequence* without involving irrational numbers; the solution includes only certain combinations of natural numbers.

## 8 Conclusions

In summary, we obtain the closed-form solution of a canonical three-term recurrence relation Eq. (4) with an arbitrary given *n*-dependent coefficient {d}_{n}. The final non-recursive expression Eq. (48) includes a finite number of elementary operations and functions.

Possible applications of the developed approaches, namely the R-sum theory and the discrete dimensional-convolution procedure, are not limited by the considered statement. Due to its universality, they could be used for solving other recursive problems, in particular many-term recurrence relations.

An interesting and open question for the author is how the solution Eq. (48) could be efficiently used for approximations and solving differential equations.

## Endnotes

We use the following notations: \{x\}=x-\u301ax\u301b, \u301ax\u301b=\lfloor x\rfloor =max(m\in \mathbb{Z}\mid m\le x).

We define double factorial for an arbitrary number m\in \mathbb{N} as follows: m!!=m\cdot (m-2)\cdot (m-4)\cdot \phantom{\rule{0.2em}{0ex}}\cdots \phantom{\rule{0.2em}{0ex}}\cdot 1.

## References

LeVeque RJ:

*Finite Difference Methods for Ordinary and Partial Differential Equations: Steady State and Time Dependent Problems*. SIAM, Philadelphia; 2007.Choun, YS: Generalization of the three-term recurrence formula and its applications (2013) http://arxiv.org/abs/arXiv:1303.0806v8

Lorentzen L, Waadeland H:

*Continued Fractions with Applications*. North-Holland, Amsterdam; 1992.Gonoskov I: Cyclic operator decomposition for solving the differential equations.

*Adv. Pure Math.*2013, 3: 178-182. 10.4236/apm.2013.31A025

## Acknowledgements

IG would like to thank his wife Alla for her help and understanding during the preparation of the manuscript.

## Author information

### Authors and Affiliations

### Corresponding author

## Additional information

### Competing interests

The author declares that he has no competing interests.

### Authors’ contributions

IG has made all substantive intellectual contributions to the published study.

## Rights and permissions

**Open Access** This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (https://creativecommons.org/licenses/by/4.0), which permits use, duplication, adaptation, distribution, and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

## About this article

### Cite this article

Gonoskov, I. Closed-form solution of a general three-term recurrence relation.
*Adv Differ Equ* **2014**, 196 (2014). https://doi.org/10.1186/1687-1847-2014-196

Received:

Accepted:

Published:

DOI: https://doi.org/10.1186/1687-1847-2014-196