Items tagged with recurrence


Hi MaplePrimes,


These two files have the same content.  One is a .pdf and the other is a Maple Worksheet.  I explore integer sequences of the form - 

a(r) = c*a(r-1)+d*a(r-2) with a(1) and a(2) given.

Some of these sequences are in (the Online Encyclopedia of Integer Sequences) and some are not.  If we restrict c to 1 and assume that a(1)=1 and a(2) = 2 we have the parameter d remaining.  See additional webpage -

Let me know if you like the code.




In Mathematica, there is a command "LinearRecurrence" that lists a sequence generated by a linear recurrence.
For example, 
LinearRecurrence[{-3, 1}, {7, 2}, 10]
will produce the first ten numbers in the sequence defined by a0=7, a1=2; a_n = -3 an-1 + an-2.

Is there anything similar in Maple? 
If not, what would be the easiest way to do the same?

UPDATE: Two answers show how to do this example with rsolve, but it seems that this solution does not help in general for recurrence of high order.

Thank you.

I have looked everywhere for help on how to format decimals to indicate they are recurring; or there is a set of numbers that is recurring. Normal notation would show a point above the the appropriate digits that follow the decimal point to indicate recurrence.

I'm sure it is simple to do but I cannot find the help that I need from the Maple help.

Regards, DLW

find x852 given that



xn=(1/9)*sqrt(7+xn-1) /xn-2


I don't know how to solve this problem.

Anyone please help me with it!

Thanks a lot

How to solve following recurrence equation:





I tried,but it doesn't work.

How to find the sequence an ?

Mariusz Iwaniuk

I'm trying to solve a recurrence relation by generating terms and looking for a pattern.  I've learned that i can't stop 

Maple's autosimplification process and the best I can do is use Parse from the InertForm package.  The hand drawn picture below is what I'm trying to replicate.  I know I can use rsolve but I'm trying to do the steps I would with pencil and paper.



How to  compute the recurrence relation and I find the problem when the summation of U because appear noise term self-canceling and I can not find the nth component of U?Mixed_volterra_-Fredholm_(278)_Ex(8.17).mw

"this program is solving Mixed Fredholmvolterra integral equation using modified decomposition method  page 278 Example(8.17) by    Creation date : (9\3\1437)   ------------------------------  u(x)=f(x,t)+(∫)[0]^(t)(∫)[0]^(1)F(x,t,r,s)*u(r,s) ⅆr ds.  -----------------------------"


f := proc (x, t) options operator, arrow; exp(-t)*(cos(x)+t*cos(x)+(1/2)*t*cos(x-1)*sin(1)) end proc:

U[0] := f1(x, t):

for i from 2 to 5 do U1[i-1] := subs({r = x, s = t}, U[i-1]); U[i] := simplify(-(int(int(F(x, t, r, s)*U1[i-1], r = 0 .. 1), s = 0 .. t))) end do:




Download Mixed_volterra_-Fredholm_(278)_Ex(8.17).mwMixed_volterra_-Fredholm_(278)_Ex(8.17).mw


thank you for helping:)


I want to solve and plot a multitime recurrence of the Samuelson Hicks Model (

Feel free to share any tips that could help.

Thank you. 

I'm trying to create and populate the Array `A` with a sequence of lower triangular matrices based on the following relation:

A[k+1][i,j] = a (1+k) A[k][i,j] + b ((1+j) A[k][i-1,j] - j A[k][i-1,j-1])

The rows and columns of each matrix are given by i and j; a and b are scalars. The structure of A is not important provided a matrix can be accessed for a given k. The highest k value will not be more than about 100.

The starting matrix for k=1 is

[-1  0]
[ 1 -1]

Any guidance on where to start with setting up the appropriate procedure would be greatly appreciated.


Greetings to all.

At the following Math.Stackexchange Discussion a certain constant was computed in relation to a Master Theorem Type recurrence being solved. This prompted me to try to identify it by the use of the eponymous command. What follows is the content of the Maple session. You may want to read the post in order to get an understanding of what the constant means and how its exact value is calculated.

> fsolve(2/2^a+1/4^a=1, a);

> identify(%);

> identify(%,all);
                                 1/2    1/2
                              2 2      3
                      arcsech(------ + ---- - 1/6 Zeta(5))
                                7       6

> evalf(log[2](1+sqrt(2)));

My questions/observations are:

  • Why does the algorithm fail to spot as simple a constant as the one above or am I just not invoking it correctly?
  • If that last formula were true the author of this code would certainly win a prize for calculating a closed form expression for an odd integer zeta function value! (To be fair here I did notice that the spurious identification disappears when the number of working digits is increased and I do understand that the identification depends critically on the number of digits.)

In concluding I would like to say, why the complicated formula and not the simple one? Let me congratulate you just the same on providing this very useful command. I have worked on pandigital approximations which are slightly related and I understand that adding an operation like the logarithm to an integer base up to some max base value can dramatically increase the search space and may not always be feasible.

Best regards,

Marko Riedel

if n in {even} then C(n,0)=((-1)^(n/2))*(factorial(n)/factorial(n/2)) and C(n,1)=0
if n in {odd} then C(n,0)=0 and C(n,1)=(2*(-1)^((n-1)/2))*(factorial(n)/factorial((n-1)/2))

i've been trying for hours to get a procedure involving this to work :(


Having a recurrence relation of the form:

f(n)*c_{n+1} + g(n)*c_n + h(n)*c_{n-1}=0

with coefficient functions f,g,h is it possible to convert this into a matrix of dimension N+1

thus if the sequences c_n are the coefficients of a series sum_{n=0}^{infinity} c_n x^n I'm only interested up to order N of the series

e.g. N=2

n=0: f(0)*c_{1} + g(0)*c_0 =0

n=1: f(1)*c_{2} + g(1)*c_1 + h(1)*c_{0}=0

n=2: g(2)*c_2 + h(2)*c_{1}=0

I initialise a matrix by recurrence, the dimension of the matrix and its elements depend on the (N1,N2) given. then, I create a vector of the same length of the matrix, its dimension is also defined by (N1,N2). then, I would like to linearsolve the matrix by the vector for a general solution with (N1,N2) as parameters. would this be possible?

here is the definition of the matrix and the vector:



I'm using Maple 14 and I'm trying to solve a system of recurrence relations with initial conditions (a Vector Autoregressive model). The system is

const:=Vector[column]([0.009421681, -0.0005441856]):
lagY:=Vector[column]([0.796519372, 0.0179147112]):
lagZ:=Vector[column]([0.133049059, 0.5240695764]):

eq1:=y(t) = A[1, 1] + A[1, 2]*y(t - 1) + A[1, 3]*z(t - 1);
eq2:=z(t) = A[2, 1] + A[2, 2]*y(t - 1) + A[2, 3]*z(t - 1);


I've got a recurrence equation system like:




doesn't work.

Is there a way to solve this with maple?

Actually I also would like to solve this step by step, by hand. Could you refer me to something that could help me, solve my problem?


1 2 Page 1 of 2