Derive a formula to calculate the combinations if you have n integers (1 to n) to where the nth digit can't be in the nth spot of the combination.
Example: {2 3 1} is good but but {3 2 1} is bad because 2 is in the second spot.
Example 2: {2 3 1 5 4} is good but {1 5 2 3 4} is bad because 1 is in the first spot.
Help please?
Example: {2 3 1} is good but but {3 2 1} is bad because 2 is in the second spot.
Example 2: {2 3 1 5 4} is good but {1 5 2 3 4} is bad because 1 is in the first spot.
Help please?