cp's OEIS Frontend

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.

A359039 Number of Wachs permutations of size n.

This page as a plain text file.
%I A359039 #33 Dec 21 2023 20:55:22
%S A359039 1,1,2,4,8,24,48,192,384,1920,3840,23040,46080,322560,645120,5160960,
%T A359039 10321920,92897280,185794560,1857945600,3715891200,40874803200,
%U A359039 81749606400,980995276800,1961990553600,25505877196800,51011754393600,714164561510400,1428329123020800
%N A359039 Number of Wachs permutations of size n.
%C A359039 A Wachs permutation pi is a permutation of [n] such that |pi^{-1}(i) - pi^{-1}(i*)| <= 1, for all 1 <= i <= n-1, where i* is defined as i-1 if i is even, i+1 if i is odd and i+1 <= n, and n otherwise.
%H A359039 Alois P. Heinz, <a href="/A359039/b359039.txt">Table of n, a(n) for n = 0..806</a>
%H A359039 Francesco Brenti and Paolo Sentinelli, <a href="https://arxiv.org/abs/2212.04932">Wachs permutations, Bruhat order and weak order</a>, arXiv:2212.04932 [math.CO], 2022.
%F A359039 If n=2m, then a(n) = m!*2^m, if n=2m+1, then a(n) = (m+1)!*2^m.
%F A359039 a(n) = A081123(n+1)*A016116(n). - _Alois P. Heinz_, Jan 23 2023
%F A359039 Sum_{n>=0} 1/a(n) = 3*sqrt(e) - 2. - _Amiram Eldar_, Jan 25 2023
%F A359039 D-finite with recurrence a(n) +2*a(n-1) +(-n-1)*a(n-2) +2*(-n+1)*a(n-3)=0. - _R. J. Mathar_, Jul 17 2023
%e A359039 For n=4, a(n)=8, since we have the 8 Wachs permutations 1234, 1243, 2134, 2143, 3412, 3421, 4312, 4321.
%p A359039 A359039 := proc(n)
%p A359039     local m ;
%p A359039     m := floor(n/2) ;
%p A359039     if type(n,'even') then
%p A359039         m!*2^m ;
%p A359039     else
%p A359039         (m+1)!*2^m ;
%p A359039     end if;
%p A359039 end proc: # _R. J. Mathar_, Jul 17 2023
%p A359039 # second Maple program:
%p A359039 a:= n-> ceil(n/2)!*2^floor(n/2):
%p A359039 seq(a(n), n=0..28);  # _Alois P. Heinz_, Dec 21 2023
%t A359039 a[n_]:=If[EvenQ[n], (n/2)! 2^(n/2), ((n + 1)/2)!*2^((n - 1)/2)]
%Y A359039 Cf. A016116, A081123.
%K A359039 nonn
%O A359039 0,3
%A A359039 _Per W. Alexandersson_, Dec 13 2022