This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A338766 #17 Apr 26 2021 08:54:20 %S A338766 1,1,2,4,16,20,32,56,148,136,186,328,894,868,1196,1896,5210,4936,6716, %T A338766 11264,30046,28168,38892,63272,169900,161848,218944,367616,966010, %U A338766 909192,1240738,2100064,5422442,5161412,7027750,11910404 %N A338766 Number of permutations p of [n] such that | |p(i) - p(i-1)| - |p(i+1) - p(i)| | = 1. %H A338766 Wikipedia, <a href="https://en.wikipedia.org/wiki/Permutation">Permutation</a> %p A338766 b:= proc(s, x, y) option remember; `if`(s={}, 1, add( %p A338766 `if`(x=0 or y=0 or abs(abs(x-y)-abs(y-j))=1, %p A338766 b(s minus {j}, y, j), 0), j=s)) %p A338766 end: %p A338766 a:= n-> b({$1..n}, 0$2): %p A338766 seq(a(n), n=0..20); %t A338766 b[s_, x_, y_] := b[s, x, y] = If[s == {}, 1, Sum[ %t A338766 If[x == 0 || y == 0 || Abs[Abs[x - y] - Abs[y - j]] == 1, %t A338766 b[s ~Complement~ {j}, y, j], 0], {j, s}]]; %t A338766 a[n_] := b[Range[n], 0, 0]; %t A338766 a /@ Range[0, 20] (* _Jean-François Alcover_, Apr 26 2021, after _Alois P. Heinz_ *) %Y A338766 Cf. A338765. %K A338766 nonn,more %O A338766 0,3 %A A338766 _Alois P. Heinz_, Nov 07 2020