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.

A177520 Number of permutations of 1..n avoiding adjacent step pattern up, down, up, down.

This page as a plain text file.
%I A177520 #22 Apr 20 2022 09:15:22
%S A177520 1,1,2,6,24,104,528,3296,23168,179712,1573632,15207424,158880768,
%T A177520 1801996288,22088716288,289379395584,4040899657728,60045059489792,
%U A177520 944460646318080,15670973219667968,273813250221277184,5024207327266603008,96554813072964845568
%N A177520 Number of permutations of 1..n avoiding adjacent step pattern up, down, up, down.
%H A177520 Alois P. Heinz, <a href="/A177520/b177520.txt">Table of n, a(n) for n = 0..460</a>
%F A177520 a(n) ~ c * d^n * n!, where d = 0.87361286073825385348141673848..., c = 1.678751353034864037734331900009... . - _Vaclav Kotesovec_, Aug 28 2014
%p A177520 b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
%p A177520       add(b(u+j-1, o-j, `if`(t=2, 3, 1)), j=1..o) +`if`(t<3,
%p A177520       add(b(u-j, o+j-1, `if`(t=1, 2, 0)), j=1..u), 0))
%p A177520     end:
%p A177520 a:= n-> b(n, 0, 0):
%p A177520 seq(a(n), n=0..30);  # _Alois P. Heinz_, Oct 07 2013
%t A177520 b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, 1,
%t A177520      Sum[b[u + j - 1, o - j, If[t == 2, 3, 1]], {j, 1, o}] + If[t < 3,
%t A177520      Sum[b[u - j, o + j - 1, If[t == 1, 2, 0]], {j, 1, u}], 0]];
%t A177520 a[n_] := b[n, 0, 0];
%t A177520 Table[a[n], {n, 0, 30}] (* _Jean-François Alcover_, Apr 20 2022, after _Alois P. Heinz_ *)
%Y A177520 Column k=0 of A230797.
%Y A177520 Column k=10 of A242784.
%K A177520 nonn
%O A177520 0,3
%A A177520 _R. H. Hardin_, May 10 2010
%E A177520 a(17)-a(22) from _Alois P. Heinz_, Oct 07 2013