login
Number of permutations sigma of [n] such that k * sigma(k) >= n for 1 <= k <= n.
2

%I #32 Mar 03 2020 10:26:24

%S 1,1,1,1,2,4,18,54,384,1920,15000,108000,1270080,8890560,126443520,

%T 1440270720,18811699200,232243200000,4303470124800,56336336179200,

%U 1165698293760000,17784994106880000,349410939842764800,6977881195084800000,173541988447027200000

%N Number of permutations sigma of [n] such that k * sigma(k) >= n for 1 <= k <= n.

%C sigma(1) = n and sigma(n) = 1.

%e In case of n = 4.

%e ----+-------------

%e 1 | [4, 2, 3, 1]

%e 2 | [4, 3, 2, 1]

%e In case of n = 5.

%e ----+----------------

%e 1 | [5, 3, 2, 4, 1]

%e 2 | [5, 3, 4, 2, 1]

%e 3 | [5, 4, 2, 3, 1]

%e 4 | [5, 4, 3, 2, 1]

%o (Ruby)

%o def A(n)

%o (2..n - 1).to_a.permutation.select{|i| (2..n - 1).all?{|j| i[j - 2] * j >= n}}.size

%o end

%o def A330432(n)

%o (0..n).map{|i| A(i)}

%o end

%o p A330432(10)

%K nonn

%O 0,5

%A _Seiichi Manyama_, Mar 01 2020

%E a(16)-a(24) from _Giovanni Resta_, Mar 03 2020