#C16.txt, March 18, 2024 Help:=proc(): print(`SR(INI,L,n), IsPer1(L,t), FindPer(L) `):end: #SR(INI,L,n): inputs a 0-1 list of length L[nops(L)] # a list of increasing positive integers L, and outputs #the sequence of 0-1 generated by them of length n #outputs the list of length n generated by the recurrence #x[t]=x[t-L[1]]+...+x[t-L[nops(L)] SR:=proc(INI,L,n) local r,i,M,ng: r:=nops(L): if nops(INI)<>L[-1] then RETURN(FAIL): fi: if not (convert(INI,set)={0,1} or convert(INI,set)={1}) then RETURN(FAIL): fi: if not (type(L,list) and {seq(type(L[i],posint),i=1..nops(L))}={true} and sort(L)=L) then RETURN(FAIL): fi: if not type(n,posint) then RETURN(FAIL): fi: M:=INI: while(nops(M))