A000506
One half of the number of permutations of [n] such that the differences have 5 runs with the same signs.
Original entry on oeis.org
61, 841, 7311, 51663, 325446, 1910706, 10715506, 58258210, 309958755, 1623847695, 8412276585, 43220104041, 220683627988, 1121561317408, 5679711010548, 28683869195556, 144552802373145, 727271783033445
Offset: 6
- L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 260, #13
- F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 260.
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
-
p[n_ /; n >= 2, 1] = 2; p[n_ /; n >= 2, k_] /; 1 <= k <= n := p[n, k] = k*p[n-1, k] + 2*p[n-1, k-1] + (n-k)*p[n-1, k-2]; p[n_, k_] = 0; t[n_, k_] := p[n, k]/2; a[n_] := t[n, 5]; Table[a[n], {n, 6, 23}] (* Jean-François Alcover, Feb 09 2016 *)
A360426
Number of permutations of [2n] having exactly n alternating up/down runs where the first run is not a down run.
Original entry on oeis.org
1, 1, 6, 118, 4788, 325446, 33264396, 4766383420, 911323052520, 224136553339270, 68929638550210620, 25914939202996628148, 11693626371194331008088, 6236691723226152102621084, 3881046492003600271067466744, 2786922888404654795314066258488, 2287283298159853722760705106305488
Offset: 0
a(0) = 1: (), the empty permutation.
a(1) = 1: 12.
a(2) = 6: 1243, 1342, 1432, 2341, 2431, 3421.
a(3) = 118: 123546, 123645, 124356, ..., 564123, 564213, 564312.
-
b:= proc(n, k) option remember; `if`(n<2, 0, `if`(k=1, 1,
k*b(n-1, k) + 2*b(n-1, k-1) + (n-k)*b(n-1, k-2)))
end:
a:= n-> `if`(n=0, 1, b(2*n, n)):
seq(a(n), n=0..17);
Original entry on oeis.org
1, 2, 3, 5, 10, 26, 87, 359, 1744, 9680, 60201, 413993, 3116758, 25485014, 224845995, 2128603307, 21520115452, 231385458428, 2636265133869, 31725150246701, 402096338484226, 5353594391608322, 74702468784746223, 1090126355291598575, 16604660518848685480
Offset: 0
a(22) = 1 + 1 + 1 + 2 + 5 + 16 + 61 + 272 + 1385 + 7936 + 50521 + 353792 + 2702765 + 22368256 + 199360981 + 1903757312 + 19391512145 + 209865342976 + 2404879675441 + 29088885112832 + 370371188237525 + 4951498053124096 + 69348874393137901.
Cf.
A000111,
A000364,
A000182,
A008280,
A008281,
A008282,
A010094,
A059720,
A008970,
A109449,
A162170.
-
b:= proc(u, o) option remember;
`if`(u+o=0, 1, add(b(o-1+j, u-j), j=1..u))
end:
a:= proc(n) option remember;
`if`(n<0, 0, a(n-1))+ b(n, 0)
end:
seq(a(n), n=0..25); # Alois P. Heinz, Oct 27 2017
-
With[{nn=30},Accumulate[CoefficientList[Series[Sec[x]+Tan[x],{x,0,nn}],x] Range[0,nn]!]] (* Harvey P. Dale, Feb 26 2012 *)
-
from itertools import accumulate
def A173253(n):
if n<=1:
return n+1
c, blist = 2, (0,1)
for _ in range(n-1):
c += (blist := tuple(accumulate(reversed(blist),initial=0)))[-1]
return c # Chai Wah Wu, Apr 16 2023
Comments