LREtools - Maple Programming Help

Home : Support : Online Help : Mathematics : Factorization and Solving Equations : LREtools : LREtools/constcoeffsol

LREtools

 constcoeffsol
 find all solutions of linear recurrence equations with constant coefficients

 Calling Sequence constcoeffsol(problem)

Parameters

 problem - problem statement or RESol for a single equation in a single recurrence variable

Description

 • Finds all solutions of the linear recurrence equation with constant coefficients.
 • Optionally, one can specify output=basis  or output=gensol, which specifies respectively that one wants a basis of the solutions or a generic solution.  The initial conditions that may be associated to the problem are only used in the generic solution case.  Arbitrary constants for the basis case are represented as _C[1], _C[2], ..., _C[n], where the _C is an escaped local variable.
 • See the help page for LREtools[REcreate] for the definition of the format of a problem.

Examples

 > $\mathrm{with}\left(\mathrm{LREtools}\right):$
 > $\mathrm{rec}≔a\left(n\right)-9a\left(n+1\right)+26a\left(n+2\right)-34a\left(n+3\right)+21a\left(n+4\right)-5a\left(n+5\right)=0:$
 > $\mathrm{constcoeffsol}\left(\mathrm{rec},a\left(n\right),\left\{\right\}\right)$
 ${-}\frac{{1}}{{5}}{}\left({-}\frac{{3125}}{{256}}{}{a}{}\left({4}\right){-}\frac{{3125}}{{256}}{}{a}{}\left({0}\right){+}\frac{{3125}}{{64}}{}{a}{}\left({1}\right){-}\frac{{9375}}{{128}}{}{a}{}\left({2}\right){+}\frac{{3125}}{{64}}{}{a}{}\left({3}\right)\right){}{\left(\frac{{1}}{{5}}\right)}^{{n}}{+}\frac{{1}}{{6}}{}\left(\frac{{5}}{{4}}{}{a}{}\left({4}\right){+}\frac{{1}}{{4}}{}{a}{}\left({0}\right){-}{2}{}{a}{}\left({1}\right){+}\frac{{9}}{{2}}{}{a}{}\left({2}\right){-}{4}{}{a}{}\left({3}\right)\right){}\left({n}{+}{1}\right){}\left({n}{+}{2}\right){}\left({n}{+}{3}\right){-}\frac{{1}}{{2}}{}\left(\frac{{85}}{{16}}{}{a}{}\left({4}\right){+}\frac{{21}}{{16}}{}{a}{}\left({0}\right){-}\frac{{41}}{{4}}{}{a}{}\left({1}\right){+}\frac{{175}}{{8}}{}{a}{}\left({2}\right){-}\frac{{73}}{{4}}{}{a}{}\left({3}\right)\right){}\left({n}{+}{1}\right){}\left({n}{+}{2}\right){+}\left(\frac{{565}}{{64}}{}{a}{}\left({4}\right){+}\frac{{181}}{{64}}{}{a}{}\left({0}\right){-}\frac{{341}}{{16}}{}{a}{}\left({1}\right){+}\frac{{1343}}{{32}}{}{a}{}\left({2}\right){-}\frac{{517}}{{16}}{}{a}{}\left({3}\right)\right){}\left({n}{+}{1}\right){-}\frac{{1845}}{{256}}{}{a}{}\left({4}\right){-}\frac{{821}}{{256}}{}{a}{}\left({0}\right){+}\frac{{1461}}{{64}}{}{a}{}\left({1}\right){-}\frac{{5023}}{{128}}{}{a}{}\left({2}\right){+}\frac{{1781}}{{64}}{}{a}{}\left({3}\right)$ (1)
 > $\mathrm{rec}≔a\left(n+4\right)=-a\left(n+3\right)+3a\left(n+2\right)+5a\left(n+1\right)+2a\left(n\right):$
 > $\mathrm{constcoeffsol}\left(\mathrm{rec},a\left(n\right),\left\{\right\}\right)$
 ${-}{2}{}\left({-}\frac{{1}}{{54}}{}{a}{}\left({3}\right){-}\frac{{1}}{{18}}{}{a}{}\left({2}\right){-}\frac{{1}}{{18}}{}{a}{}\left({1}\right){-}\frac{{1}}{{54}}{}{a}{}\left({0}\right)\right){}{{2}}^{{n}}{+}\left({-}\frac{{13}}{{27}}{}{a}{}\left({3}\right){-}\frac{{4}}{{9}}{}{a}{}\left({2}\right){+}\frac{{14}}{{9}}{}{a}{}\left({1}\right){+}\frac{{68}}{{27}}{}{a}{}\left({0}\right)\right){}{\left({-}{1}\right)}^{{n}}{+}\frac{{1}}{{2}}{}\left({-}\frac{{1}}{{3}}{}{a}{}\left({3}\right){+}{a}{}\left({1}\right){+}\frac{{2}}{{3}}{}{a}{}\left({0}\right)\right){}{\left({-}{1}\right)}^{{n}}{}\left({n}{+}{1}\right){}\left({n}{+}{2}\right){+}\left(\frac{{7}}{{9}}{}{a}{}\left({3}\right){+}\frac{{1}}{{3}}{}{a}{}\left({2}\right){-}\frac{{8}}{{3}}{}{a}{}\left({1}\right){-}\frac{{20}}{{9}}{}{a}{}\left({0}\right)\right){}{\left({-}{1}\right)}^{{n}}{}\left({n}{+}{1}\right)$ (2)
 > $\mathrm{rec}≔a\left(n+2\right)-2a\left(n+1\right)-a\left(n\right)=0:$
 > $\mathrm{constcoeffsol}\left(\mathrm{rec},a\left(n\right),\left\{\right\}\right)$
 ${-}\frac{{1}}{{4}}{}{\sum }_{{\mathrm{_α}}{=}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{+}{2}{}{\mathrm{_Z}}{-}{1}\right)}\phantom{\rule[-0.0ex]{5.0px}{0.0ex}}\frac{\left(\left({-}{3}{}{a}{}\left({0}\right){+}{a}{}\left({1}\right)\right){}{\mathrm{_α}}{+}{a}{}\left({0}\right){-}{a}{}\left({1}\right)\right){}{{\mathrm{_α}}}^{{-}{n}}}{{\mathrm{_α}}}$ (3)