#M7.txt: Maple Code for Lecture 7 of Math 454,Combinatorics, Rutgers University, taught by Dr. Z. (Doron Zeilberger) Help7:=proc():print(` Rec(P,n) , SeqRec(P,n), GFseq(f,x,N) `): end: with(combinat): #Rec(P,n): inputs a pair P=[L,INI], where L=[a1,a2,..,ak] (where k=nops(L)), of numbers and another list INI=[e_0,...,e_(k-1)] of numbers of the SAME size #and a positive ineteger n, outputs the n-th term x(n) of the sequence defined by the recurrence #x(n)=a1*x(n-1)+ ...+ ak*x(n-k), for n>=k with the INITIAL CONDITIONS x(i)=e_{i} for i=0..k-1. For example to get #the 100-th Fibonacci number, try: #Rec([1,1],[0,1],100); Rec:=proc(P,n) local L, INI,k,i: option remember: #We first unpack P L:=P[1]: INI:=P[2]: k:=nops(L): if nops(INI)<>k then print(INI, `should have`, k, `entries `): RETURN(FAIL): fi: if n