OFFSET
0,3
LINKS
Christian Sievers, Table of n, a(n) for n = 0..450
FORMULA
a(n) = Sum_{d|n} A000255(d-1). - Christian Sievers, Jun 22 2025
EXAMPLE
The permutation (1,2,5,6,3,4,7,8) has maximal runs ((1,2),(5,6),(3,4),(7,8)), with lengths (2,2,2,2), so is counted under a(8).
The a(0) = 1 through a(4) = 13 permutations:
() (1) (12) (123) (1234)
(21) (132) (1324)
(213) (1432)
(321) (2143)
(2413)
(2431)
(3142)
(3214)
(3241)
(3412)
(4132)
(4213)
(4321)
MATHEMATICA
Table[Length[Select[Permutations[Range[n]], SameQ@@Length/@Split[#, #2==#1+1&]&]], {n, 0, 10}]
PROG
(PARI) a(n)=if(n, sumdiv(n, d, sum(i=0, d-1, (-1)^i*(d-i)!*binomial(d-1, i))), 1) \\ 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
