#OK to post homework #Joseph Koutsoutis, 03-24-2024, Assignment 16 read `C16.txt`: #1 done #2 qSR := proc(q,INI,L,n) local r,M,i,ng: r := nops(L): M := INI: while nops(M) < n do: ng := add(M[-L[i][2]] * L[i][1], i=1..r) mod q: M := [op(M), ng]: od: return(M): end: #3 # Here was the code I ran to find the periods: # FindPer(qSR(3,[1,2,1],[[1,2],[2,3]],10000)) outputted 26 # FindPer(qSR(5,[1,2,4,1,2],[[1,2],[2,5]],10000)) outputted 744 # FindPer(qSR(11,[3,1,2,4,3],[[1,2],[2,5]],10000)) outputted 3660 # FindPer(qSR(5,[1,0,0,0,0,0],[[3,4],[2,5],[3,6]],10000)) outputted 744