login
A391511
Number of permutations p of [n] satisfying Sum_{i=1..n} (p(i)-i)^2 = n*(n+1)/2.
2
1, 0, 0, 2, 2, 0, 0, 78, 380, 0, 0, 43106, 230894, 0, 0, 46470939, 295990436, 0, 0, 93486183164, 677977634271, 0, 0, 303816912226577, 2444144451253085, 0, 0, 1454786596073959830, 12758706122701884626, 0, 0
OFFSET
0,4
COMMENTS
Number of permutations of [n] with "entropy" equal to n*(n+1)/2.
FORMULA
a(n) = A175929(n,n*(n+1)/4) if n in { A014601 }.
a(n) = 0 <=> n in { A042963 }.
a(n) = A179264(n) - A179266(n).
EXAMPLE
a(0) = 1: the empty permutation.
a(3) = 2: 231, 312.
a(4) = 2: 2413, 3142.
a(7) = 78: 1247653, 1265473, 1273654, 1275436, ..., 5143267, 5231476, 5312476, 5321467.
a(8) = 380: 12378564, 12378645, 12386745, 12457863, ..., 62135487, 62143587, 62314578, 63124578.
MAPLE
b:= proc(s) option remember; (n-> `if`(n=0, 1, add(expand(
x^((n-j)^2)*b(s minus {j})), j=s)))(nops(s))
end:
a:= n-> coeff(b({$1..n}), x, n*(n+1)/2):
seq(a(n), n=0..12);
KEYWORD
nonn,more
AUTHOR
Alois P. Heinz, Dec 11 2025
STATUS
approved