OFFSET
0,4
LINKS
Christian Sievers, Table of n, a(n) for n = 0..449
FORMULA
a(n) = Sum_{k=1..n} ( T(n,k) * A000255(n-k) ) for n>=1, where T(n,k) is the number of compositions of n into k distinct parts (cf. A072574). - Christian Sievers, Jun 22 2025
EXAMPLE
The permutation (1,2,4,3,5,7,8,6,9) has maximal anti-runs ((1),(2,4,3,5,7),(8,6,9)), with lengths (1,5,3), so is counted under a(9).
The a(0) = 1 through a(4) = 17 permutations:
() (1) (2,1) (1,3,2) (1,2,4,3)
(2,1,3) (1,3,2,4)
(2,3,1) (1,4,2,3)
(3,1,2) (1,4,3,2)
(3,2,1) (2,1,3,4)
(2,1,4,3)
(2,3,1,4)
(2,4,1,3)
(2,4,3,1)
(3,1,4,2)
(3,2,1,4)
(3,2,4,1)
(3,4,2,1)
(4,1,3,2)
(4,2,1,3)
(4,3,1,2)
(4,3,2,1)
MATHEMATICA
Table[Length[Select[Permutations[Range[n]], UnsameQ@@Length/@Split[#, #2!=#1+1&]&]], {n, 0, 10}]
PROG
(PARI) a(n)=if(n, my(b(n)=sum(i=0, n-1, (-1)^i*(n-i)!*binomial(n-1, i)), d=sqrtint(2*n), p=polcoef(prod(i=1, n, 1+x*y^i, 1+O(y*y^n)*((1-x^(d+1))/(1-x))), n, y)); sum(i=1, d, b(n+1-i)*i!*polcoef(p, i)), 1) \\ Christian Sievers, Jun 22 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 21 2025
EXTENSIONS
a(11) and beyond from Christian Sievers, Jun 22 2025
STATUS
approved
