Question: A recursive sequence

I wrote a code for the following sequence. But I have a problem. What are the good methods for defining recursive sequence?

THE CODE

restart;
#FIRST STEP: Lets find the recursive formula for 
d:=proc(m)
option remember;
d(1):=1;
if m>1 then return -sum(xi(i)*d(i-k+1),i=2..m) else 1 fi;
end proc:
#lets check
for i from 1 to 4 do
d(i);
end do; 

 

 

Secondly, I want to create a matrix as follows. I wrote the code. I think it is right.

restart:
m:=4:
DD:=Matrix(m,m):
#SECOND STEP: Lets find the matrix 
for i from 1 to m do 
p:=0:
for j from 1 to m do 
 
if i<=j then p:=p+1:
DD[i,j]:=d(p);
 fi: 
end do;
p:=1: 
end do:
DD;

 

 

 

 

Please Wait...