A250284 Number of permutations p of [n] such that p(i) > p(i+1) iff i == 0 (mod 7).
1, 1, 1, 1, 1, 1, 1, 1, 7, 35, 119, 329, 791, 1715, 3431, 45031, 400281, 2313633, 10467037, 39845281, 132908041, 398840401, 7677528495, 98103087719, 800524248391, 5030038213949, 26202586666879, 117991927960739, 472105349529479, 11979440405949527
Offset: 0
Keywords
Examples
a(7) = 1: 1234567. a(8) = 7: 12345687, 12345786, 12346785, 12356784, 12456783, 13456782, 23456781.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..500
Crossrefs
Row n=7 of A181937.
Programs
-
Maple
b:= proc(u, o, t) option remember; `if`(u+o=0, 1, `if`(t=0, add(b(u-j, o+j-1, irem(t+1, 7)), j=1..u), add(b(u+j-1, o-j, irem(t+1, 7)), j=1..o))) end: a:= n-> b(n, 0$2): seq(a(n), n=0..35);
-
Mathematica
nmax = 30; CoefficientList[Series[1 + Sum[(x^(7 - k) * HypergeometricPFQ[{1}, {8/7 - k/7, 9/7 - k/7, 10/7 - k/7, 11/7 - k/7, 12/7 - k/7, 13/7 - k/7, 2 - k/7}, -x^7/823543])/(7 - k)!, {k, 0, 6}] / HypergeometricPFQ[{}, {1/7, 2/7, 3/7, 4/7, 5/7, 6/7}, -x^7/823543], {x, 0, nmax}], x] * Range[0, nmax]! (* Vaclav Kotesovec, Apr 21 2021 *)