#OK to post homework #Wanying Rao, 03/07/2021, Assignment 13 #2 Franklin := proc(L) local LL,i,j,m,s: if nops(L) = 1 then RETURN(FAIL): fi: LL := L: s := 1: j := 1: while j <= nops(L) - 1 do if L[j] - L[j+1] = 1 then s := s + 1: fi: j := j + 1: od: m := L[nops(L)]: if m > s then RETURN(FAIL): else for i from 1 to m do LL[i] := LL[i]+1: od: LL := LL[1..nops(LL)-1]: fi: end: #3 FranklinOldMaids := proc(n) local s,m,p,L: L := []: for p in PnD(n,{0}) do if Franklin(p) = FAIL then L := [op(L),p]: fi: od: L: end: