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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A285672 Number of permutations p of [n] avoiding consecutive odd sums i+p(i), (i+1)+p(i+1) for all i in [n-1]. 3

%I #8 Aug 30 2021 09:39:27

%S 1,1,1,2,8,36,180,1008,6336,46080,374400,3369600,32659200,344736000,

%T 3886444800,47348582400,611264102400,8442272563200,122595843686400,

%U 1890952003584000,30510694932480000,520011800985600000,9231875243458560000,172292221923655680000

%N Number of permutations p of [n] avoiding consecutive odd sums i+p(i), (i+1)+p(i+1) for all i in [n-1].

%H Alois P. Heinz, <a href="/A285672/b285672.txt">Table of n, a(n) for n = 0..466</a>

%e a(0) = 1: the empty permutation.

%e a(1) = 1: 1.

%e a(2) = 1: 12.

%e a(3) = 2: 123, 321.

%e a(4) = 8: 1234, 1432, 2413, 2431, 3214, 3412, 4213, 4231.

%e a(5) = 36: 12345, 12543, 13524, 13542, 14325, 14523, 15324, 15342, 24135, 24153, 24315, 24351, 24513, 24531, 31524, 31542, 32145, 32541, 34125, 34521, 35124, 35142, 42135, 42153, 42315, 42351, 42513, 42531, 51324, 51342, 52143, 52341, 53124, 53142, 54123, 54321.

%p b:= proc(n, i, j, p, t) option remember; `if`(n=0, 1,

%p `if`(i=0 or t=1 and p=1, 0, i*b(n-1, i-1, j, 1-p, p))+

%p `if`(j=0 or t=1 and p=0, 0, j*b(n-1, i, j-1, 1-p, 1-p)))

%p end:

%p a:= n-> b(n, floor(n/2), ceil(n/2), 1, 0):

%p seq(a(n), n=0..25);

%t b[n_, i_, j_, p_, t_] := b[n, i, j, p, t] =

%t If[n==0, 1, If[i==0 || t ==1 && p==1, 0, i*b[n-1, i-1, j, 1-p, p]] +

%t If[j==0 || t==1 && p==0, 0, j*b[n-1, i, j-1, 1-p, 1-p]]];

%t a[n_] := b[n, Floor[n/2], Ceiling[n/2], 1, 0];

%t Table[a[n], {n, 0, 25}] (* _Jean-François Alcover_, Aug 30 2021, after _Alois P. Heinz_ *)

%Y Cf. A199660, A231601.

%K nonn

%O 0,4

%A _Alois P. Heinz_, Apr 24 2017

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 18:17 EDT 2024. Contains 371962 sequences. (Running on oeis4.)