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!)
A262745 Number of permutations of [n] with an odd number of rises. 2

%I #11 Nov 01 2021 04:23:42

%S 0,0,1,4,12,52,360,2656,20160,177472,1814400,20135296,239500800,

%T 3102326272,43589145600,654789062656,10461394944000,177738781376512,

%U 3201186852864000,60837094646972416,1216451004088320000,25542995336828157952,562000363888803840000

%N Number of permutations of [n] with an odd number of rises.

%H Alois P. Heinz, <a href="/A262745/b262745.txt">Table of n, a(n) for n = 0..400</a>

%F E.g.f.: (1/(1-x) -1 -tanh(x))/2.

%F a(n) = A000142(n) - A128103(n).

%e a(2) = 1: 12.

%e a(3) = 4: 132, 213, 231, 312.

%p b:= proc(u, o, t) option remember; `if`(u+o=0, t,

%p add(b(u-j, o+j-1, t), j=1..u)+

%p add(b(u+j-1, o-j, 1-t), j=1..o))

%p end:

%p a:= n-> b(n, 0$2):

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

%t b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, t,

%t Sum[b[u - j, o + j - 1, t], {j, 1, u}] +

%t Sum[b[u + j - 1, o - j, 1 - t], {j, 1, o}]];

%t a[n_] := b[n, 0, 0];

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

%Y Cf. A000142, A128103.

%K nonn

%O 0,4

%A _Alois P. Heinz_, Sep 29 2015

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 September 16 23:59 EDT 2024. Contains 375984 sequences. (Running on oeis4.)