The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A338766 Number of permutations p of [n] such that | |p(i) - p(i-1)| - |p(i+1) - p(i)| | = 1. 1
 1, 1, 2, 4, 16, 20, 32, 56, 148, 136, 186, 328, 894, 868, 1196, 1896, 5210, 4936, 6716, 11264, 30046, 28168, 38892, 63272, 169900, 161848, 218944, 367616, 966010, 909192, 1240738, 2100064, 5422442, 5161412, 7027750, 11910404 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 LINKS Wikipedia, Permutation MAPLE b:= proc(s, x, y) option remember; `if`(s={}, 1, add(       `if`(x=0 or y=0 or abs(abs(x-y)-abs(y-j))=1,          b(s minus {j}, y, j), 0), j=s))     end: a:= n-> b({\$1..n}, 0\$2): seq(a(n), n=0..20); MATHEMATICA b[s_, x_, y_] := b[s, x, y] = If[s == {}, 1, Sum[      If[x == 0 || y == 0 || Abs[Abs[x - y] - Abs[y - j]] == 1,      b[s ~Complement~ {j}, y, j], 0], {j, s}]]; a[n_] := b[Range[n], 0, 0]; a /@ Range[0, 20] (* Jean-François Alcover, Apr 26 2021, after Alois P. Heinz *) CROSSREFS Cf. A338765. Sequence in context: A212202 A102545 A045521 * A242205 A076434 A192150 Adjacent sequences:  A338763 A338764 A338765 * A338767 A338768 A338769 KEYWORD nonn,more AUTHOR Alois P. Heinz, Nov 07 2020 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified January 22 15:13 EST 2022. Contains 350481 sequences. (Running on oeis4.)