 constcoeffsol - Maple Help

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, _C, ..., _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),\varnothing \right)$
 ${-}\frac{\left({-}\frac{{3125}{}{a}{}\left({4}\right)}{{256}}{-}\frac{{3125}{}{a}{}\left({0}\right)}{{256}}{+}\frac{{3125}{}{a}{}\left({1}\right)}{{64}}{-}\frac{{9375}{}{a}{}\left({2}\right)}{{128}}{+}\frac{{3125}{}{a}{}\left({3}\right)}{{64}}\right){}{\left(\frac{{1}}{{5}}\right)}^{{n}}}{{5}}{+}\frac{\left(\frac{{5}{}{a}{}\left({4}\right)}{{4}}{+}\frac{{a}{}\left({0}\right)}{{4}}{-}{2}{}{a}{}\left({1}\right){+}\frac{{9}{}{a}{}\left({2}\right)}{{2}}{-}{4}{}{a}{}\left({3}\right)\right){}\left({n}{+}{1}\right){}\left({n}{+}{2}\right){}\left({n}{+}{3}\right)}{{6}}{-}\frac{\left(\frac{{85}{}{a}{}\left({4}\right)}{{16}}{+}\frac{{21}{}{a}{}\left({0}\right)}{{16}}{-}\frac{{41}{}{a}{}\left({1}\right)}{{4}}{+}\frac{{175}{}{a}{}\left({2}\right)}{{8}}{-}\frac{{73}{}{a}{}\left({3}\right)}{{4}}\right){}\left({n}{+}{1}\right){}\left({n}{+}{2}\right)}{{2}}{+}\left(\frac{{565}{}{a}{}\left({4}\right)}{{64}}{+}\frac{{181}{}{a}{}\left({0}\right)}{{64}}{-}\frac{{341}{}{a}{}\left({1}\right)}{{16}}{+}\frac{{1343}{}{a}{}\left({2}\right)}{{32}}{-}\frac{{517}{}{a}{}\left({3}\right)}{{16}}\right){}\left({n}{+}{1}\right){-}\frac{{1845}{}{a}{}\left({4}\right)}{{256}}{-}\frac{{821}{}{a}{}\left({0}\right)}{{256}}{+}\frac{{1461}{}{a}{}\left({1}\right)}{{64}}{-}\frac{{5023}{}{a}{}\left({2}\right)}{{128}}{+}\frac{{1781}{}{a}{}\left({3}\right)}{{64}}$ (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),\varnothing \right)$
 ${-}{2}{}\left({-}\frac{{a}{}\left({3}\right)}{{54}}{-}\frac{{a}{}\left({2}\right)}{{18}}{-}\frac{{a}{}\left({1}\right)}{{18}}{-}\frac{{a}{}\left({0}\right)}{{54}}\right){}{{2}}^{{n}}{+}\left({-}\frac{{13}{}{a}{}\left({3}\right)}{{27}}{-}\frac{{4}{}{a}{}\left({2}\right)}{{9}}{+}\frac{{14}{}{a}{}\left({1}\right)}{{9}}{+}\frac{{68}{}{a}{}\left({0}\right)}{{27}}\right){}{\left({-1}\right)}^{{n}}{+}\frac{\left({-}\frac{{a}{}\left({3}\right)}{{3}}{+}{a}{}\left({1}\right){+}\frac{{2}{}{a}{}\left({0}\right)}{{3}}\right){}{\left({-1}\right)}^{{n}}{}\left({n}{+}{1}\right){}\left({n}{+}{2}\right)}{{2}}{+}\left(\frac{{7}{}{a}{}\left({3}\right)}{{9}}{+}\frac{{a}{}\left({2}\right)}{{3}}{-}\frac{{8}{}{a}{}\left({1}\right)}{{3}}{-}\frac{{20}{}{a}{}\left({0}\right)}{{9}}\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),\varnothing \right)$
 ${-}\frac{\left(\left({-}\frac{{3}{}{a}{}\left({0}\right)}{{4}}{+}\frac{{a}{}\left({1}\right)}{{4}}\right){}\left(\sqrt{{2}}{-}{1}\right){+}\frac{{a}{}\left({0}\right)}{{4}}{-}\frac{{a}{}\left({1}\right)}{{4}}\right){}{\left(\sqrt{{2}}{-}{1}\right)}^{{-}{n}}}{\sqrt{{2}}{-}{1}}{-}\frac{\left(\left({-}\frac{{3}{}{a}{}\left({0}\right)}{{4}}{+}\frac{{a}{}\left({1}\right)}{{4}}\right){}\left({-}{1}{-}\sqrt{{2}}\right){+}\frac{{a}{}\left({0}\right)}{{4}}{-}\frac{{a}{}\left({1}\right)}{{4}}\right){}{\left({-}{1}{-}\sqrt{{2}}\right)}^{{-}{n}}}{{-}{1}{-}\sqrt{{2}}}$ (3)