Find the number of such sequence A[0...n — 1] that satisfies A[i] equals the number of i in A[0...n — 1].
For example , if n = 9, there is only one solution [5, 2, 1, 0, 0, 1, 0, 0, 0]. (We use bruteforce to prove it)
We guess that if n > 6, there is only one solution and it takes the form of [n — 4, 2, 1, 0, 0, ..., 1, ...,0, 0].
We want to know whether it is right.