|
EXAMPLE
|
n=2: permutations are
per={{1,2},{2,1}},
per(2)={2,1} is the first derangement, hence a(2)=2;
n=3: permutations are
per={{1,2,3},{1,3,2},{2,1,3},{2,3,1},{3,1,2},{3,2,1}},
per(3)= {2,1,3} is the first derangement, hence a(3)=2;
n=4: permutations are
per={{1,2,3,4},{1,2,4,3},{1,3,2,4},{1,3,4,2},{1,4,2,3},{1,4,3,2},{2,1,3,4},{2,1,4,3},{2,3,1,4},{2,3,4,1},{2,4,1,3},{2,4,3,1},{3,1,2,4},{3,1,4,2},{3,2,1,4},{3,2,4,1},{3,4,1,2},{3,4,2,1},{4,1,2,3},{4,1,3,2},{4,2,1,3},{4,2,3,1},{4,3,1,2},{4,3,2,1}},
per(8)= {2,1,4,3} is the first derangement, hence a(4)=8.
|