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.

A356853 Number of permutations p of [2n+1] such that at most one element of {p(1),...,p(i-1)} is between p(i) and p(i+1) for all i <= 2n and p(2n+1) = n+1.

This page as a plain text file.
%I A356853 #14 Sep 03 2022 22:10:51
%S A356853 1,2,20,216,2720,36228,503216,7171404,104142520,1533200656,
%T A356853 22811374568,342216338652,5168324302672,78483423004680,
%U A356853 1197266739443160,18335055482658748,281714880491273736,4340894020114398672,67055152953864109240,1038097819961270208088
%N A356853 Number of permutations p of [2n+1] such that at most one element of {p(1),...,p(i-1)} is between p(i) and p(i+1) for all i <= 2n and p(2n+1) = n+1.
%H A356853 Alois P. Heinz, <a href="/A356853/b356853.txt">Table of n, a(n) for n = 0..832</a>
%F A356853 a(n) = A356692(2n,n).
%e A356853 a(0) = 1: 1.
%e A356853 a(1) = 2: 132, 312.
%e A356853 a(2) = 20: 12453, 12543, 14253, 14523, 15243, 15423, 21453, 21543, 25143, 25413, 41253, 41523, 45123, 45213, 51243, 51423, 52143, 52413, 54123, 54213.
%e A356853 a(3) = 216: 1235764, 1236754, 1237564, 1237654, ..., 7651234, 7651324, 7652134, 7653124.
%p A356853 b:= proc(u, o) option remember; `if`(u+o=0, 1,
%p A356853       add(b(sort([o-j, u+j-1])[]), j=1..min(2, o))+
%p A356853       add(b(sort([u-j, o+j-1])[]), j=1..min(2, u)))
%p A356853     end:
%p A356853 a:= n-> b(n$2):
%p A356853 seq(a(n), n=0..20);
%p A356853 # second Maple program:
%p A356853 b:= proc(n, k) option remember; `if`(k<0 or k>n, 0,
%p A356853       `if`(n=0, 1, add(b(n-1, j), j=k-2..k+1)))
%p A356853     end:
%p A356853 a:= n-> b(2*n, n):
%p A356853 seq(a(n), n=0..20);
%Y A356853 Cf. A356692.
%K A356853 nonn
%O A356853 0,2
%A A356853 _Alois P. Heinz_, Aug 31 2022