We describe algorithm Hyper which can be used to find all hypergeometric solutions of linear recurrences with polynomial coefficients . 1 . Introduction. Let K be ...
J. Symbolic Computation (1992) 14, 243-264
Hypergeometric Solutions of Linear Recurrences with Polynomial Coefficients MARKO PETKOVSEK Department of Mathematics, University of Ljubljana, Slovenia
We describe algorithm Hyper which can be used to find all hypergeometric solutions of linear recurrences with polynomial coefficients .
1 . Introduction Let K be a field of characteristic zero . We assume that K is computable, meaning that the elements of K can be finitely represented and that there exist algorithms for carrying out the field operations . Let K N denote the ring of all sequences over K, with addition and multiplication defined term-wise . Following Stanley (1980) we identify two sequences if they agree from some point on . Formally, we are working in the quotient ring SK := K N /J where J is the ideal of sequences with at most finitely many non-zero terms . Hence all equalities of the form L(n) = R(n) are to be interpreted as valid for all large enough n . Accordingly, a sequence is considered non-zero if and only if it has infinitely many non-zero terms . A sequence a E SK will be called polynomial (respectively rational) a polynomial f (x) E K[x] (respectively a rational function f (x) E K(x)) such that a(n) = f (n) for all large enough n E IN . A non-zero sequence a E SK is a hypergeometric term (or simply hypergeometric) over K if there is a rational function r(x) E K(x) such that a(n + 1) = r(n)a(n) for all large enough n E IN . Two hypergeometric terms are similar if their ratio is rational . We will denote the sets of polynomial, rational, and hypergeometric sequences over K by PK , RK, and 1(K, respectively. By L(HK) we will denote the linear subspace spanned by ?{K in the K-linear space SK. DEFINITION 1 .1 . over K if there is
Since two polynomials which agree on infinitely many arguments are identical, the polynomial defining a polynomial sequence is unique, and we will not distinguish ber tween the two . The same goes for rational functions and sequences . In fact, PK is a ring isomorphic to K[x] and RK is a field isomorphic to K(x) . It is easy to see that ?{K is a multiplicative group . For any field F, let F* denote its multiplicative group . Then f : 7{K RK * defined by f : h(n) ' h(n+ 1)/h(n) is an epimorphism which induces an 0747-7171/92/080243+22 $08 .00/0
© 1992 Academic Press Limited
244
M . Petkovgek
isomorphism between ?1K/K* and RK Obviously, similarity is a congruence relation in 7{K induced by the normal subgroup R K * . EXAMPLE 1 .1 . Let a(n) = 0, b(n) = 1, c(n) = n 2 -1, d(n) = 2", e(n) = 2n-1, f(n) = n! . Then sequences a, b, c are polynomial over K, sequences b, c, d, f are hypergeometric over K, and sequences a, e belong to G(NK) but are not hypergeometric over K .
Let S denote the shift operator in the ring K'N, defined by Sa(n) = a(n + 1) . There is a unique endomorphism E of SK such that E(a + J) = Sa + J, for every a E K N . It is easy to see that E is in fact an automorphism of SK, and thus (SK, E) is an inversive difference ring, according to the definition in Cohn (1965) . Let d be a positive integer and ro(n), r i (n), . . ., rd(n) sequences from RK such that rd # 0 . Then L :_ Ed o r,E' is a linear recurrence operator with rational coef ficients over K . We will be interested in algorithms for finding hypergeometric solutions of equations of the form La = f where L is as above and f E SK . Clearly, for every linear recurrence operator with rational coefficients there exists a linear recurrence operator with polynomial coefficients having the same kernel . Furthermore, every linear recurrence operator L can be written in the form L = L o Em where Lo is an operator with non-zero trailing coefficient . Thus the affine solution space L - ' f equals E - ' Lo i f, for any f E SK . Therefore we will from now on assume that L is of the form d L :_
d
pi E'
(1 .1)
i-o
where po(n), pi(n), . . ., pd(n) are sequences from PK such that Po, Pd # 0 . The order of L as defined in (1 .1) is d, and its degree is m := maxo < i ci,J ak
I
i,j,k,I
e each summation index Lawher ranges over all integers and the order of summation can be chosen arbitrarily. Replacing j by r = m + I - j yields
= ~ n r E ak E r
k
I (k)
1
~ i
k-1
ci, .n+I-r .
The coefficient of nr can be written as 3)
(2 .13)
~ak>2 k I () b~
where j = k-I and s = k+m-r . By definition of so, we have b(' ) = 0 for 0 _< i < s < so . By our convention, this also holds when j > s since then ci,,_j = 0 . If j < 0 the binomial coefficient in (2 .13) is zero ; if j > 0 and s < so then b(') = 0 . So the inner sum in (2 .13) vanishes whenever s < so, i.e ., when k < so - m + r . On the other hand, ak == 0 for k > No, hence the terms of the outer sum in (2 .13) are zero unless so - m + r < k < No . As a consequence, (2 .13) is zero unless r < m + No - so, so degLa2piE`a= EpirjEjr a i-o i-o i-o
is a non-zero rational multiple of
a. 0
PROPOSITION 5 .2 . Every sequence from C(HK) can be written as a sum of pairwise dissimilar hypergeometric terms .
Since the sum of two similar hypergeometric terms is either hypergeornetric or zero, the desired representation can be achieved by grouping together similar terms . 0 PROOF .
THEOREM 5 .1 . Let S be a non-empty set of hypergeometric terms . If S is linearly dependent over RK then S contains two similar hypergeometric terms . PROOF .
on
Let S C _
'HK
be linearly dependent over 9ZK . We prove the assertion by induction
ISI .
If ISS = 1 then S is not linearly dependent over RK . If SI > 1, let S' = { a1, a2, . . . , a m } be a minimal subset of S which is linearly dependent over RK . Then there exist non-zero elements r1, r2, . . ., rm E RK such that E ;"- 1 riai = 0 . Let bi := riai, for i = 1, 2, . . . , m . Then b i E WK, and I
M
E bi = 0 . i-1
For i = 1, 2, . . . , m, let si := Ebi/bi . Apply the resulting equations to find
E
to (5 .1), multiply (5 .1) by sm , then subtract
m-1 (si - sm)bi = 0 . i_1
(5 .2)
260
M . Petkov§ek
If Si = s m for some i then bi and b,,, are constant multiples of each other, hence ai and a m are similar . Otherwise all terms in (5 .2) are hypergeometric . By induction hypothesis there exist j and k, j # k, such that (sj - sm )bj and (Sk - s m )bk are similar . But then so are aj and a k . 0 5 .1 . Let L be a linear recurrence operator with polynomial coefficients, and E L(WK) such that La = 0 . If a = Ek-1 ai where ai are pairwise dissimilar hypergeometric terms then COROLLARY
a
Lai = 0,
for i = 1, 2, . . ., k .
By Proposition 5 .1, for each i there exists a rational sequence ri such that Lai = riai . Therefore PROOF .
k
0 = La =
k
Lai = riai .
Since the ai are pairwise dissimilar Theorem 5 .1 implies that ri = 0, for all i . 0 COROLLARY 5 .2 . Let L be a linear recurrence operator the space KerL n£(WK) has a basis in WK .
with polynomial coefficients . Then
Let a E .C(WK) satisfy La = 0 . By Proposition 5 .2, we can write a = Eki=1 ai where ai are pairwise dissimilar hypergeometric terms . By Corollary 5 .1, each ai satisfies Lai = 0 . It follows that hypergeometric solutions of (1 .2) span the space of solutions from £(?IK) . To obtain a basis for KerLflC(?IK), select a maximal linearly independent set of hypergeometric solutions of (1 .2) . 0 PROOF .
PROPOSITION
5 .3 . Let r, h, hi, C, Ci be
non-zero sequences from SK such that
h(n + 1) = C(n + 1) h(n) - r(n) C(n) h,(n + 1) = r(n) C,(n + 1) hi (n) Ci (n) and C is a K-linear combination of Ci . Then
PROOF .
for i = 1,2, . . .,k,
(5 .3)
(5 .4)
h is a K-linear combination of hi .
From (5 .3) and (5 .4) it follows that there are constants a, ai E K and jo E IN
such that n-1
h(n) = a
11 r(j) C(n) j=jo
and n-1
hi(n) = ai (r()) jCi(n), j=jo
for i = 1,2, . . .,k .
Hypergeometric Solutions of Recurrences
Let C
= E ki=1
261
A Ci where Ai E K . Then k
h(n)
=
Eai i=1
n-1
k
r(j)
1
aiCi(n)
=
hi(n) Ea ' ai i=1
j=ja
0 Modify Hyper so that it will not stop after finding one hypergeometric solution but will rather test all possible choices of A(n), B(n), and Z . Return all hypergeometric solutions h which satisfy h(n + 1) = S(n)h(n) where S(n) - Z E~n~ C(n+) and C is a basic polynomial solution found by Poly on the corresponding auxiliary recurrence . From Theorem 4 .1, Corollary 5 .2, and Proposition 5 .3 it follows that this modified algorithm will produce a generating set for the space of solutions which belong to G(nK) . In general, this will not be a basis because the same hypergeometric solution may be obtained from several auxiliary recurrences . One can prune this set until it becomes a basis, testing for linear dependence by means of the Casoratian determinant . Another way to obtain such a basis is to find one hypergeometric solution with Hyper, then reduce the order of the recurrence, recursively find the corresponding basis for the reduced recurrence, and use Gosper's algorithm to put the antidifferences of these solutions into closed form if possible . This method will actually yield a larger class of solutions (cf. Examples 4 .2 and 4 .5) . 5 .2 . NON-HOMOGENEOUS RECURRENCES In this subsection we show how to solve (1 .3) over ,C(WK) when f # 0 . PROPOSITION 5 .4 . Up to the order of the terms, the representation of sequences from G(nK) as sums of pairwise dissimilar hypergeometric terms is unique . PROOF . Assume that a1, a2, . . . , ak and b1, b2,, . . , b,,, are pairwise dissimilar hypergeo-
metric terms with k
m
E ai = I: b j . i=1
( 5 .5)
j=1
Using induction on k + m we prove that k = m and that each ai equals some bj . If k + m = 0 this holds trivially . Let k + m > 0 . Then by Theorem 5 .1 it follows that k > 0, m > 0, and some ai is similar to some bj . Relabel the terms so that at is similar to b,,,, and let h := ak - b,,, . If h # 0 then we can use induction hypothesis both on k-1 Em-1 Z k_ 1 ai E "`-1 bj - h, to find that k = m-1 and ai + h = = j=1 E j=1 b • and i=1 j: k - 1 = m . This contradiction shows that h = 0, so ak = b n, and i=1 ai = ;) i 1 b, . By induction hypothesis, k = m and each ai with 1 < i -< k - 1 equals some Dj with 1