#P4161. Distinct Row Counts in Permutation Game
Distinct Row Counts in Permutation Game
Distinct Row Counts in Permutation Game
Windy has learned a permutation game. For numbers from \(1\) to \(N\), there is a unique bijection from \(\{1,2,\dots,N\}\) to itself. Initially, Windy writes the numbers in order \(1,2,3,\dots,N\) on a sheet of paper. In the next row, he writes the corresponding images under the bijection, and then repeats this procedure: each new row is formed by applying the bijection to the row immediately above it.
The process stops when the newly formed row is again \(1,2,3,\dots,N\). Note that if the permutation has an order \(k\) (i.e. \(\pi^k\) is the identity and \(k\) is the smallest such positive integer), then the process produces \(k+1\) rows including both the first and the last (repeated) row. For example, when \(N=6\) and the mapping is given by
\(1\to2,\; 2\to3,\; 3\to1,\; 4\to5,\; 5\to4,\; 6\to6\),
the rows are:
1 2 3 4 5 6
2 3 1 5 4 6
3 1 2 4 5 6
1 2 3 5 4 6
2 3 1 4 5 6
3 1 2 5 4 6
1 2 3 4 5 6
Since the number of rows equals the order of the permutation plus one, Windy wonders: for all possible bijections (permutations) on \(\{1,2,\dots,N\}\), how many distinct values of row count (i.e. distinct values of \(\text{order}+1\)) can occur?
Your task is to compute that number given \(N\).
inputFormat
The input consists of a single integer (N) ((1 \le N \le 10)), representing the number of elements.
outputFormat
Output a single integer representing the number of distinct possible row counts (which equals (\text{order}+1)) that may be obtained from all possible bijections on ({1,2,\dots,N}).
sample
1
1