1. **Base Case: n=2**
For n=2, we have the permutations (1,2) and (2,1). Clearly, (2,1) is a friendly permutation of (1,2) by reversing the first 2 elements. Thus, the base case holds.
2. Inductive Step:
Assume the statement is true for some n. That is, we can enumerate all permutations of (1,2,…,n) as P1,P2,…,Pn! such that Pi+1 is a friendly permutation of Pi for all i=1,2,…,n!, and Pn!+1=P1.
3. **Constructing the Sequence for n+1:**
Start with P1=(1,2,…,n,n+1). By the inductive hypothesis, we can generate a sequence of friendly permutations up to Pn!=(n,n−1,…,2,1,n+1).
4. Algorithm for Generating Friendly Permutations:
- If c⋅n!=j for some positive integer c≤n+1, reverse the sequence of Pj to get Pj+1.
- Turn Pj+1 into Pj+n! by reversing the first n terms of Pj+1 and fixing the last term. All Pi for j+1≤i≤j+n! are distinct by the inductive hypothesis.
5. **Generating (n+1)! Permutations:**
Each time we apply the algorithm, we take the string of numbers (n+1−c,n−c,…,2,1,n+1,n,…,n+2−c) and produce (n+2−c,n+3−c,…,n,n+1,1,2,…,n−c,n+1−c). This process will generate (n+1)! distinct permutations.
6. Completing the Induction:
By induction, we have shown that for any n, we can enumerate all permutations of (1,2,…,n) such that Pi+1 is a friendly permutation of Pi for all i=1,2,…,n!, and Pn!+1=P1.
■