login
A371800
Number of permutations p of [n] whose fixed points j < n have a larger right neighbor p(j+1) > j.
0
1, 1, 2, 5, 18, 85, 494, 3389, 26730, 238021, 2360462, 25791485, 307793178, 3982831525, 55540518014, 830287473629, 13245448695210, 224589628828741, 4033344237266222, 76476839514843965, 1526730007443860538, 32008234421462900965, 703123406641373962334, 16149704161940128467869
OFFSET
0,3
COMMENTS
Number of permutations of [n] where no fixed point has a smaller right neighbor.
FORMULA
a(n) mod 2 = A000035(n) for n >= 1.
EXAMPLE
a(3) = 5: 123, 132, 213, 231, 312.
a(4) = 18 = 4! - 6: all permutations of [4] except 1432, 2431, 3214, 4132, 4213, 4231.
MAPLE
b:= proc(s, t) option remember; (n-> `if`(n<2, 1, add(
`if`(j=n and t, 0, b(s minus {j}, is(j<n))), j=s)))(nops(s))
end:
a:= n-> b({$1..n}, false):
seq(a(n), n=0..16);
MATHEMATICA
b[s_, t_] := b[s, t] = Module[{n = Length[s]}, If[n < 2, 1, Sum[
If[j == n && t, 0, b[s ~Complement~ {j}, j < n]], {j, s}]]];
a[n_] := b[Range[n], False];
Table[a[n], {n, 0, 20}] (* Jean-François Alcover, May 10 2024, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A089412 A058798 A122596 * A020029 A020119 A109995
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Apr 25 2024
STATUS
approved