Closed-form solution of a general three-term recurrence relation
aa r X i v : . [ m a t h . C A ] N ov arXiv/ Closed-form solution of a general three-term recurrence relation
Ivan Gonoskov ∗ Department of Physics, Ume˚a University, SE-90187 Ume˚a, Sweden (Dated: November 20, 2013)We present a closed-form solution for n-th term of a general three-term recurrence relation witharbitrary given n-dependent coefficients. The derivation and corresponding proof are based on twoapproaches, which we develop and describe in detail. First, the recursive-sum theory, which gives theexact 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, includinga finite number of elementary operations and functions.
I. INTRODUCTION
A general three-term recurrence relation is usually defined by the following expression: W n +1 = A n W n + B n W n − , (1)where n ≥ n ∈ N ), W n is unknown function of n , A n and B n are arbitrary given functions of n , and W = C , W = C are initial conditions (we assume not a trivial case when C = C = 0 and W n ≡ f ( x ) and arbitrary given U ( x ), namely: f ′′ − U ( x ) · f = 0. There-fore, it is widely used for the analytical and numerical analysis (and approximations) in corresponding physical andmathematical applications, see for example [1].Second, three-term recurrence relations appear naturally when one uses Frobenius method for solving some lineardifferential equations and studying some special functions, see [2].Third, the relation Eq.(1) corresponds to the continued fraction with arbitrary given coefficients. Basically, thethree-term recurrence relation corresponds to the expressions for the numerators and denominators of this continuedfraction (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 equivalentto Eq.(1) in the case of ( A n = 0 , ∀ n ). Our goal is to obtain the solution consisting of a finite number of terms, ratherthan a variety of methods with infinite series [4]. In that way we develop two approaches for the expressions with afinite number of terms. We start with the recursive-sum theory, which is presented in sec.III. It allows to obtain theexact solution of the three-term recurrence relation in a compact form using a recursive indexing. Next, we develop thediscrete dimensional-convolution procedure, which allows to eliminate recursive indexing and represent the solutionas a closed-form expression. It means, that the final closed-form expression depends on arbitrary given coefficientsand includes a finite number of elementary operations, such as: “ + ”, “ − ”, “ × ”, “ ÷ ”; and elementary functions,such as: Heaviside step function (or unit step function) and floor function for integer division. II. PRELIMINARIES
Let us start from the simplification of the Eq.(1). For this we assume that A n = 0 , ∀ n (opposite case is not usuallydefined as a standard three-term recurrence relation and should be considered separately). Thus, we can use thefollowing substitution: a n +1 = W n +1 · n Y i =1 A i . (2)According to this substitution and Eq.(1), a n is fulfilled the following three-term recurrence relation: ∗ [email protected] a n +1 = a n + B n A n A n − · a n − . (3)Since the Eq.(1), Eq.(3) are linear and n, A n , B n are arbitrary, we could assume without loss of generality thefollowing initial conditions: a = 1 , a = 1. Finally, we specify d n = B n · ( A n A n − ) − as an arbitrary given functionof n, and write below the expression, which we further call canonical three-term recurrence relation : a n +1 = a n + d n · a n − ,a = 1 , a = 1 . (4)We note, that the solution of Eq.(4) consist of a sum of d i -products ( i ∈ N ) with different powers . Here we meanthat 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. thelargest power among all the products in a n +1 , is equal to J ( n + 1) / K , since: J ( n + 1) / K = max (cid:16) J n/ K , J ( n − / K (cid:17) , ∀ n, (5)where we use Gauss notation for the integer division: J x K = ⌊ x ⌋ = max (cid:0) m ∈ Z | m ≤ x (cid:1) . Because of this fundamentalcharacteristic it is natural to express a n +1 , i.e. the solution of Eq.(4), in the following form: a n +1 = 1 + J ( n +1) / K X p =1 S ( n, p ) , (6)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 thecorresponding recursive-sum, and rigorously proof all the propositions. III. RECURSIVE-SUM THEORY
In this section we start from the definition of a general recursive-sum (R-sum). Next, we present and proof some ofits properties, which could 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 caseof R-sum, namely reduced R-sum which is described in the next section.
Definition I : A general R-sum ( R ) is defined for the ordered sequence ( d i , i ∈ Z ) by the following expression: R = R ( N, k, ∆ , ∆ ) = k Y m =1 N + m · ∆ X i m = i m − +∆ d i m , (7)where ( N, k, ∆ , ∆ ∈ Z ), i ≡ ∆ , N is an order of the R-sum, k ≥ is an initial shift of the R-sum. For the correct definition it is also assumed that N ≥ ∆ and d i is defined for all indexes used in Eq.(7). The product in Eq.(7) corresponds to the standard left-to-right order ofmultiplication, so the definition could be written also in the following way: R ( N, , ∆ , ∆ ) = N +∆ X i =∆ +∆ d i , R ( N, , ∆ , ∆ ) = N +∆ X i =∆ +∆ d i · N +2∆ X i = i +∆ d i , R ( N, , ∆ , ∆ ) = N +∆ X i =∆ +∆ d i · N +2∆ X i = i +∆ d i · N +3∆ X i = i +∆ d i , ... · · · R ( N, k, ∆ , ∆ ) = N +∆ X i =∆ +∆ d i · N +2∆ X i = i +∆ d i · · · · · N +( k − X i k − = i k − +∆ d i k − · N + k ∆ X i k = i k − +∆ d i k . (8)Next, we present some of the R-sum elementary properties P.(1-3), which are following directly from the definition.P.(1): R ( N, k, ∆ , N ) = k Y j =1 d N + j · ∆ . (9)P.(2): R ( N, k + 1 , ∆ , ∆ ) = N +∆ X j =∆ +∆ d j · R ( N + ∆ , k, ∆ , j ) . (10)P.(3): R ( N, k, ∆ , ∆ + 1) = R ( N, k, ∆ , ∆ ) − d ∆ +∆ · R ( N + ∆ , k − , ∆ , ∆ + ∆) . (11)Finally, we consider the R-sum key lemma : If N ≥ ∆ + 1, then: R ( N, k + 1 , ∆ , ∆ ) = R ( N − , k + 1 , ∆ , ∆ ) + d N +( k +1)∆ · R ( N, k, ∆ , ∆ ) . (12) Proof of the key lemma :First, we consider the difference D = (cid:2) R ( N, k + 1 , ∆ , ∆ ) − d N +( k +1)∆ · R ( N, k, ∆ , ∆ ) (cid:3) and try to eliminate indexnumbers which correspond to zero terms in the original expression. For the correct procedure (when an upper boundin each sum is always not less than the lower one) we will eliminate zero terms and delete the corresponding indexnumbers step by step from i to i k +1 . D = N +∆ X i =∆ +∆ d i · N +2∆ X i = i +∆ d i · · · · · N + k ∆ X i k = i k − +∆ d i k · N +( k +1)∆ X i k +1 = i k +∆ d i k +1 − d N +( k +1)∆ . (13)At the next step we note that for i = N + ∆ according to the definition we have only one value i = N + 2∆ andone term d N +2∆ in the second sum in Eq.(13). According to the definition and P.(1) the same is true for the otherindexes: i = N + 3∆, ..., i k = N + k ∆. The last term in Eq.(13) gives N +( k +1)∆ X i k +1 = N + k ∆+∆ d i k +1 − d N +( k +1)∆ ≡ i = N + ∆ are equal to zero. Since the condition( N ≥ ∆ + 1), we could then write: D = ( N − X i =∆ +∆ d i · N +2∆ X i = i +∆ d i · · · · · N + k ∆ X i k = i k − +∆ d i k · N +( k +1)∆ X i k +1 = i k +∆ d i k +1 − d N +( k +1)∆ . (14)The same procedure can be repeated for any successive indexes. Consider the m -th sum ( m ≤ k ) in Eq.(13). For each i m = N + m ∆ we have only one term in the next sum, corresponding to i m +1 = N + ( m + 1)∆, and so on until thelast term: N +( k +1)∆ X i k +1 = N + k ∆+∆ d i k +1 − d N +( k +1)∆ ≡
0. So we can delete all the corresponding index numbers and write: D = ( N − X i =∆ +∆ d i · ( N − X i = i +∆ d i · · · · · ( N − k ∆ X i k = i k − +∆ d i k · N +( k +1)∆ X i k +1 = i k +∆ d i k +1 − d N +( k +1)∆ . (15)Finally, we note that N +( k +1)∆ X i k +1 = i k +∆ d i k +1 − d N +( k +1)∆ = ( N − k +1)∆ X i k +1 = i k +∆ d i k +1 . Thus we obtain: D = ( N − X i =∆ +∆ d i · ( N − X i = i +∆ d i · · · · · ( N − k ∆ X i k = i k − +∆ d i k · ( N − k +1)∆ X i k +1 = i k +∆ d i k +1 = R ( N − , k + 1 , ∆ , ∆ ) , (16)which proves the key lemma. IV. EXACT SOLUTION OF A CANONICAL THREE-TERM RECURRENCE RELATION VIA FINITER-SUM EXPANSION
In this section we start with a definition of a reduced R-sum, a particular case of the general R-sum. Then, weconstruct the exact solution of the canonical three-term recurrence relation , by using the R-sum key lemma.
Definition II : A reduced R-sum ( ˜R ) is a particular case of the general R-sum (see Eqs.(7-8)), and defined by thefollowing expression: ˜R = ˜R ( N, k ) = R ( N, k, , −
1) = N +2 X i =1 d i · N +4 X i = i +2 d i · · · · · N +2( k − X i k − = i k − +2 d i k − · N +2 k X i k = i k − +2 d i k . (17)The key lemma Eq.(12) gives the following for the reduced R-sum: ˜R ( N, k + 1) = ˜R ( N − , k + 1) + d N +2( k +1) · ˜R ( N, k ) . (18)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 − p ; k = k ( n, p ) = p . In that way we consider a new subsidiary function: S ( n, p ) = ˜R ( n − p, p ) . (19)According to the previous notations we have: N ( n, p ) = n − p = n − k = 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 Eq.(18) and Eq.(19): S ( n + 2 , p + 1) = S ( n + 1 , p + 1) + d n +2 · S ( n, p ) . (20)Now, we will rigorously proof a theorem about the exact solution of a canonical three-term recurrence relation Eq.(4).
Theorem I
Exact solution of Eq.(4) is following: a n +1 = 1 + J ( n +1) / K X p =1 S ( n, p ) . (21)Proof of the theorem I. Our proof is based on mathematical induction. Base cases: n = 1 : a = 1 + d = 1 + X p =1 S (1 , p ) .n = 2 : a = 1 + d + d = 1 + X p =1 S (2 , p ) ,n = 3 : a = 1 + d + d + d + d d = 1 + X p =1 S (3 , p ) ,n = 4 : a = 1 + d + d + d + d + d d + d d + d d = 1 + X p =1 S (4 , p ) . (22)Inductive step: we will proof that the statement Eq.(21) for a n and a n − , ∀ n gives the following: a n + d n · a n − = a n +1 . (23)To proof it for all n , we consider below two cases. First case: n is an arbitrary even number, n = 2 m, m ∈ N . Secondcase: n is an arbitrary odd number, n = 2 m + 1 , m ∈ N .First case, n = 2 m . a n + d n · a n − = a m + d m · a m − = 1 + d m + m X l =1 S (2 m − , l ) + d m · m − X p =1 S (2 m − , p ) . (24)Note, that m X l =1 S (2 m − , l ) = S (2 m − ,
1) + m X l =2 S (2 m − , l ) = S (2 m − ,
1) + m − X p =1 S (2 m − , p + 1). After thesubstitution we have: a n + d n · a n − = 1 + d m + S (2 m − ,
1) + m − X p =1 S (2 m − , p + 1) + d m · m − X p =1 S (2 m − , p )= 1 + d m + S (2 m − ,
1) + m − X p =1 h S (2 m − , p + 1) + d m · S (2 m − , p ) i . (25)According to Eq.(20) we could write: S (2 m − , p + 1) + d m · S (2 m − , p ) = S (2 m, p + 1). Also, according to thedefinitions Eq.(17) and Eq.(19) we could write: d m + S (2 m − ,
1) = d m + m − X j =1 d j = m X j =1 d j = S (2 m, a n + d n · a n − = 1 + S (2 m,
1) + m − X p =1 S (2 m, p + 1)= 1 + S (2 m,
1) + m X p =2 S (2 m, p ) = 1 + m X p =1 S (2 m, p ) = a n +1 , (26)which proves the first case of the theorem.Second case, n = 2 m + 1. a n + d n · a n − = a m +1 + d m +1 · a m = 1 + d m +1 + m X l =1 S (2 m, l ) + d m +1 · m X p =1 S (2 m − , p ) . (27)Similar to the previous case, we write: m X l =1 S (2 m, l ) = S (2 m, m − X p =1 S (2 m, p +1). Also we note that m X p =1 S (2 m − , p ) = m − X p =1 S (2 m − , p ) + S (2 m − , m ). Thus, we could write: a n + d n · a n − = 1 + d m +1 + S (2 m,
1) + d m +1 S (2 m − , m ) + m − X p =1 h S (2 m, p + 1) + d m +1 · S (2 m − , p ) i . (28)According to Eq.(20) we again could rewrite: S (2 m, p + 1) + d m +1 · S (2 m − , p ) = S (2 m + 1 , p + 1). In addition wenote that m − X p =1 S (2 m + 1 , p + 1) = m X p =2 S (2 m + 1 , p ). Summarizing, we could obtain: a n + d n · a n − = 1 + d m +1 + S (2 m,
1) + d m +1 S (2 m − , m ) + m X p =2 S (2 m + 1 , p ) . (29)Finally, we note that d m +1 S (2 m − , m ) = d m +1 ˜R ( − , m ) = d m +1 m Y j =1 d j − = ˜R ( − , m + 1) = S (2 m + 1 , m + 1).In addition, we could write d m +1 + S (2 m,
1) = d m +1 + m X j =1 d j = m +1 X j =1 d j = S (2 m + 1 , a n + d n · a n − = 1 + S (2 m + 1 ,
1) + S (2 m + 1 , m + 1) + m X p =2 S (2 m + 1 , p ) = 1 + m +1 X p =1 S (2 m + 1 , p ) = a n +1 , (30)which proves the second case and the theorem I. V. DISCRETE DIMENSIONAL-CONVOLUTION PROCEDURE
In this section we develop a procedure which could be used for the transformation of the exact solution Eq.(21) tothe expression without recursive indexing.Let us start from a simple case to demonstrate the idea of the discrete dimensional-convolution procedure. Weconsider a simple expression, which could be associated with a particular case of R-sum. E = N X i =1 N X i = i + δ f ( i , i ) , (31)where N , N ∈ N , ( N ≤ N ) are arbitrary given natural numbers; δ ∈ N , (0 ≤ δ ≤ [ N − N ]) is an arbitrary givennatural number (shift); and f ( i , i ) is an arbitrary given function of natural index numbers i and i . The previousexpression E could be rewritten as follows: E = N X i =1 N X i =1 F ( i , i ) , (32)where F ( i , i ) = f ( i , i ) · H ( i − i − δ ), and H ( x ) is Heaviside step function (or unit step function): H ( x ) = (cid:26) , x ≥ , x < i and i could be associated with two dimensions by thefollowing way. Let us consider a two dimensional plot (array with elements F ( i , i )) with horizontal numberingrelated to i index and vertical numbering related to i index, see the figure below. F (1 , F (1 , · · · F (1 , N ) F (2 , F (2 , · · · F (2 , N )... . . . ... F ( N , F ( N , · · · F ( N , N ) For numbering of this array of elements it is possible to use a traversal rule with one global index q ∈ [1 , . . . , N · N ]instead of i ∈ [1 , . . . , N ] and i ∈ [1 , . . . , N ]. Consider, for example, the following rule: q = i + N · ( i − * : i = i ( q ) = 1 + N (cid:8) ( q − /N (cid:9) = q − N J ( q − /N K , i = i ( q ) = 1 + J ( q − /N K .Since, for the presented rule, a unique combination of ( i , i ) corresponds to a certain unique number q and vice versa(i.e. we have one-to-one mapping), we could rewrite the Eq.(32) in the following form: E = N · N X q =1 F (cid:16) N (cid:8) ( q − /N (cid:9) , J ( q − /N K (cid:17) . (34)The presented procedure, i.e. the reduction from two dimensions to one dimension, is a particular case of discretedimensional-convolution procedure . Let us now generalize it to a multidimensional case. In that way we consider amultidimensional analog of Eq.(32): E k = N X i =1 N X i =1 · · · N k X i k =1 F ( i , i , . . . , i k ) , (35)where ( k ∈ N ), k ≥ N , N , . . . , N k ∈ N ) - is an array of arbitrary givennatural numbers, and F ( i , i , . . . , i k ) - is an arbitrary given function of i , i , . . . , i k .The previous expression is related to the calculation of a reduced R-sum. According to the definition of the reducedR-sum Eq.(17) and the substitution from Eqs.(31-32) we could write: ˜R ( N, k ) = N X i =1 N X i =1 · · · N k X i k =1 d i · k Y m =2 h d i m H ( i m − i m − − i! = N X i =1 N X i =1 · · · N k X i k =1 ˜ F ( i , i , . . . , i k ) , (36) * We use the following notations: (cid:8) x (cid:9) = x − J x K , J x K = ⌊ x ⌋ = max (cid:0) m ∈ Z | m ≤ x (cid:1) . where N j = N + 2 j , ( j ∈ N ), and H ( x ) - is the unit step function (see Eq.(33)).Let us now define a global index q as follows: q = i + N ( i −
1) + N N ( i −
1) + . . . + " k − Y j =1 N j ( i k − . (37)Note, that the minimum value q min = 1 corresponds to the case then every index number is equal to unity. Themaximum value q max = N · N · · · · · N k corresponds to the case then every index number reaches its maximum,since the relation: N + N ( N −
1) + N N ( N −
1) + . . . + " k − Y j =1 N j ( N k −
1) = " k Y j =1 N j . (38)Now we construct one-to-one mapping between the global index q and the index numbers ( i , . . . , i k ). For that weneed to solve the Eq.(37), i.e. to express any certain index number as a function of q (not depending on any otherindex numbers). We do that separately for i , i k , and all others i r , (2 ≤ r ≤ [ k − i :Since ( i − < N , the expression (cid:8) ( q − /N (cid:9) does not depend on any index numbers except i . Thus, we obtain: i = i ( q ) = 1 + N (cid:8) ( q − /N (cid:9) . (39)Obtaining of i k :Since i + N ( i −
1) + N N ( i −
1) + . . . + " k − Y j =1 N j ( i k − − − < " k − Y j =1 N j , (see Eq.(37)), the expression t ( q − (cid:30) k − Y j =1 N j | does not depend on any index numbers except i k . Thus we obtain: i k = i k ( q ) = 1 + t ( q − (cid:30) k − Y j =1 N j | . (40)Obtaining of i r , (2 ≤ r ≤ [ k − h r = h r ( i , . . . , i r ) = i + . . . + " r − Y j =1 N j ( i r − . (41)According to Eq.(38) we have: h r − < " r Y j =1 N j . In addition, we have simple relations: (cid:8) u/v (cid:9) · v ≡ u for u < v ,and (cid:8) u/v (cid:9) · v ≡ u/v ) ∈ N . Thus we obtain: h r = 1 + ( ( q − (cid:30) r Y j =1 N j ) · r Y j =1 N j . (42)Next, we perform a step similar to the one we performed when obtain i k (see also Eq.(40)). i r = 1 + t ( h r − (cid:30) r − Y j =1 N j | . (43)Finally, we could write: i r = i r ( q ) = 1 + t N r ( ( q − (cid:30) r Y j =1 N j ) | . (44)As can be seen, Eq.(39) corresponds to Eq.(44) if we put formally r = 1. In addition, we could write( q − ≡ ( ( q − (cid:30) k Y j =1 N j ) · k Y j =1 N j . This means that Eq.(40) also corresponds to Eq.(44) if we put formally r = k .Thus we can write the described substitution for the discrete dimensional-convolution procedure in the following form: q = i + N ( i −
1) + N N ( i −
1) + . . . + " k − Y j =1 N j ( i k − , q ∈ " , . . . , k Y j =1 N j ; i r = 1 + t N r ( ( q − (cid:30) r Y j =1 N j ) | , r ∈ " , . . . , k . (45)According to the previous equations every certain unique index number combination corresponds to the unique valueof q . In addition, the total number of different index number combinations is equal to the total number of differentvalues of q . Thus, we can conclude that Eq.(45) describes the one-to-one mapping for Eq.(35), and we can write: E k = N · N · ··· · N k X q =1 F (cid:16) i ( q ) , . . . , i k ( q ) (cid:17) . (46)Summarizing, the proposed procedure allows one to calculate a reduced R-sum without recursive indexing. VI. 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 recursiveindexing. By using the exact solution via R-sum expansion Eq.(21), and discrete dimensional-convolution procedureEq.(36), Eq.(45-46), we finally obtain: a n +1 = 1 + J ( n +1) / K X p =1 M ( n,p ) X q =1 G ( n, p, q ) ; M ( n, p ) = p Y r =1 ( n − p + 2 r ) = p − Y l =0 ( n − l ) ,G ( n, p, q ) = d g (1 ,n,p,q ) · p Y m =2 " d g ( m,n,p,q ) · H h g ( m, n, p, q ) − g ( m − , n, p, q ) − i ,g (1 , n, p, q ) = q − ( n − p + 2) t ( q − (cid:30) ( n − p + 2) | ,g ( m, n, p, q ) = 1 + t ( q − (cid:30) m − Y j =1 ( n − p + 2 j ) | − ( n − p + 2 m ) t ( q − (cid:30) m Y j =1 ( n − p + 2 j ) | . (47)Remark:For the definition of the integer-valued function g we use Eq.(45) and Gauss notation for the floor function: J x K = ⌊ x ⌋ = x − { x } = max (cid:0) m ∈ Z | m ≤ x (cid:1) ; H ( x ) is the unit step function, see Eq.(33). VII. CONCLUSIONS
In summary, we obtain the the closed-form solution of a canonical three-term recurrence relation Eq.(4) with anarbitrary given n -dependent coefficient d n . The final non-recursive expression Eq.(47) includes a finite number ofelementary 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 usedfor solving other recursive problems, in particular many-term recurrence relations.An interesting and open question for the author, is how the solution Eq.(47) could be efficiently used for approxi-mations and solving differential equations. [1] Randall J. LeVeque, Finite Difference Methods for Ordinary and Partial Differential Equations: Steady State and TimeDependent Problems , Society for Industrial and Applied Mathematics (SIAM), Philadelphia, (2007).[2] Yoon Seok Choun,
Generalization of the three-term recurrence formula and its applications , arXiv:1303.0806v8, (2013).[3] Lisa Lorentzen and Haakon Waadeland,
Continued Fractions with Applications , Amsterdam, Netherlands: North-Holland,(1992).[4] Ivan Gonoskov,
Cyclic Operator Decomposition for Solving the Differential Equations , Advances in Pure Mathematics,3