Help wanted for a interesting problem.

Правка en1, от EarthMessenger, 2023-04-12 12:07:43

You're given an integer n, answer the number of inversions in all the derangement permutations of length n. For example, if n = 3, there are two derangement premutations, 231 and 312, so the answer is 4.

There is such a sequence in OEIS. But I want to know how this is derived.

It's welcomed if you have other linear solution.

Теги math, derangement, inversions, oeis

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский EarthMessenger 2023-04-12 12:07:43 399 Initial revision (published)