OFFSET
0,4
LINKS
Christian Sievers, Table of n, a(n) for n = 0..5000
FORMULA
a(n) = Sum_{k=1..n} ( T(n,k) * A000255(k-1) ) 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,6,7,8,9,3,4,5) has maximal runs ((1,2),(6,7,8,9),(3,4,5)), with lengths (2,4,3), so is counted under a(9).
The a(0) = 1 through a(7) = 25 permutations:
() (1) (12) (123) (1234) (12345) (123456) (1234567)
(231) (2341) (23451) (123564) (1234675)
(312) (4123) (34512) (123645) (1234756)
(45123) (124563) (1245673)
(51234) (126345) (1273456)
(145623) (1456723)
(156234) (1672345)
(231456) (2314567)
(234156) (2345167)
(234561) (2345671)
(312456) (3124567)
(345126) (3456127)
(345612) (3456712)
(412356) (4567123)
(451236) (4567231)
(456231) (4567312)
(456312) (5123467)
(561234) (5612347)
(562341) (5671234)
(564123) (6712345)
(612345) (6723451)
(634512) (6751234)
(645123) (7123456)
(7345612)
(7561234)
MATHEMATICA
Table[Length[Select[Permutations[Range[n]], UnsameQ@@Length/@Split[#, #2==#1+1&]&]], {n, 0, 10}]
PROG
(PARI) lista(n)=my(b(n)=sum(i=0, n-1, (-1)^i*(n-i)!*binomial(n-1, i)), d=sqrtint(2*n), p=prod(i=1, n, 1+x*y^i, 1+O(y*y^n)*((1-x^(n+1))/(1-x))+O(x*x^d))); Vec(1+sum(i=1, d, i!*b(i)*polcoef(p, i))) \\ Christian Sievers, Jun 22 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 19 2025
EXTENSIONS
a(11) and beyond from Christian Sievers, Jun 22 2025
STATUS
approved
