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.

A367495 Number of up-down permutations p of [n] such that for all i the number of elements p(j) between p(i) and p(i+1) for j>i+1 differs from the number of elements p(k) between p(i+1) and p(i+2) for k>i+2.

This page as a plain text file.
%I A367495 #12 Dec 12 2023 16:42:59
%S A367495 1,1,1,1,2,4,11,37,147,684,3611,21345,139794,1004293,7853728,66413562,
%T A367495 603851552,5874507617,60886603188,669797203196,7794401498440,
%U A367495 95662364870740,1234953443995817,16728449735374081,237245379727483160,3515622139828164851
%N A367495 Number of up-down permutations p of [n] such that for all i<n-1 the number of elements p(j) between p(i) and p(i+1) for j>i+1 differs from the number of elements p(k) between p(i+1) and p(i+2) for k>i+2.
%H A367495 Alois P. Heinz, <a href="/A367495/b367495.txt">Table of n, a(n) for n = 0..250</a>
%H A367495 Wikipedia, <a href="https://en.wikipedia.org/wiki/Permutation">Permutation</a>
%e A367495 a(0) = 1: (), the empty permutation.
%e A367495 a(1) = 1: 1.
%e A367495 a(2) = 1: 12.
%e A367495 a(3) = 1: 132.
%e A367495 a(4) = 2: 1423, 3412.
%e A367495 a(5) = 4: 13254, 15243, 35142, 45132.
%e A367495 a(6) = 11: 132645, 142635, 162534, 164523, 264513, 341625, 361524, 364512, 461523, 561423, 563412.
%p A367495 b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
%p A367495       add(`if`(j=t, 0, b(o-1+j, u-j, j)), j=1..u))
%p A367495     end:
%p A367495 a:= n-> b(n, 0$2):
%p A367495 seq(a(n), n=0..30);
%Y A367495 Cf. A000111, A005817.
%K A367495 nonn
%O A367495 0,5
%A A367495 _Alois P. Heinz_, Nov 20 2023