1. [0,0,0,1,1,1,1,0,1,0] {1,6} [r, u, s, t, e, r, g] {1,5} 2. NuFP:=proc(p) local i,n: options remember: n:=0: for i from 1 to nops(p) do if i = p[i] then n:=n+1 fi: od: n: end: 3. Der:=proc(n) local l,i,r: options remember: r:=[]: l:=MyPerms(n): for i from 1 to nops(l) do if NuFP(l[i])=0 then r:=[op(r),l[i]]: fi: od: r: end: 4. [1, 0, 1, 2, 9, 44, 265, 1854, 14833] The sequence [seq(nops(Der(i)),i=0..8)] is the number of derrangements for each index from 0 to n. Foe example, the 4th index of the sequence is 9 because there are 9 derrangements for permutations of length 4. OEIS definition: Subfactorial or rencontres numbers, or derangements: number of permutations of n elements with no fixed points. 5. c(n) = 2^(n-1)