A225588 Number of descent sequences of length n.
1, 1, 2, 4, 9, 23, 67, 222, 832, 3501, 16412, 85062, 484013, 3004342, 20226212, 146930527, 1146389206, 9566847302, 85073695846, 803417121866, 8032911742979, 84796557160893, 942648626858310, 11009672174119829, 134809696481902160, 1727161011322322267, 23110946295566466698, 322435363123261622935
Offset: 0
Keywords
Examples
The a(5)=23 descent sequences of length 5 are (dots for zeros) 01: [ . . . . . ] 02: [ . . . . 1 ] 03: [ . . . 1 . ] 04: [ . . . 1 1 ] 05: [ . . 1 . . ] 06: [ . . 1 . 1 ] 07: [ . . 1 . 2 ] 08: [ . . 1 1 . ] 09: [ . . 1 1 1 ] 10: [ . 1 . . . ] 11: [ . 1 . . 1 ] 12: [ . 1 . . 2 ] 13: [ . 1 . 1 . ] 14: [ . 1 . 1 1 ] 15: [ . 1 . 1 2 ] 16: [ . 1 . 2 . ] 17: [ . 1 . 2 1 ] 18: [ . 1 . 2 2 ] 19: [ . 1 1 . . ] 20: [ . 1 1 . 1 ] 21: [ . 1 1 . 2 ] 22: [ . 1 1 1 . ] 23: [ . 1 1 1 1 ]
Links
- Joerg Arndt, Alois P. Heinz and Vaclav Kotesovec, Table of n, a(n) for n = 0..490 (first 200 terms from Joerg Arndt and Alois P. Heinz)
- David Callan, On Ascent, Repetition and Descent Sequences, arXiv:1911.02209 [math.CO], 2019.
Crossrefs
Cf. A225624 (triangle: descent sequences by numbers of descents).
Programs
-
Maple
b:= proc(n, i, t) option remember; `if`(n<1, 1, add(b(n-1, j, t+`if`(j b(n-1, 0, 0): seq(a(n), n=0..30); # Alois P. Heinz, May 13 2013
-
Mathematica
b[n_, i_, t_] := b[n, i, t] = If[n<1, 1, Sum[b[n-1, j, t + If[jJean-François Alcover, Apr 09 2015, after Alois P. Heinz *)
-
Sage
# Program adapted from Alois P. Heinz's Maple code in A022493. # b(n,i,t) gives the number of length-n postfixes of descent sequences # with a prefix having t descents and last element i. @CachedFunction def b(n,i,t): if n<=1: return 1 return sum( b(n-1, j, t+(j
Comments