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.

A231228 Number of permutations of [n] with exactly one occurrence of one of the consecutive patterns 123, 1432, 2431, 3421.

This page as a plain text file.
%I A231228 #14 Jan 03 2021 09:24:42
%S A231228 0,0,0,1,9,59,358,2235,14658,103270,778451,6315499,54733657,507655301,
%T A231228 5003179539,52430810493,580611272956,6796733911852,83658527086447,
%U A231228 1083027034959367,14678725047527255,208344799726820123,3084495765476262875,47646333262275943521
%N A231228 Number of permutations of [n] with exactly one occurrence of one of the consecutive patterns 123, 1432, 2431, 3421.
%H A231228 Alois P. Heinz, <a href="/A231228/b231228.txt">Table of n, a(n) for n = 0..200</a>
%F A231228 a(n) ~ c * (2/Pi)^n * n! * n, where c = 3.08472832460941829086964816782... . - _Vaclav Kotesovec_, Aug 28 2014
%e A231228 a(3) = 1: 123.
%e A231228 a(4) = 9: 1243, 1342, 1432, 2134, 2341, 2431, 3124, 3421, 4123.
%e A231228 a(5) = 59: 12435, 12534, 13245, ..., 53124, 53421, 54123.
%e A231228 a(6) = 358: 124365, 125364, 125463, ..., 653124, 653421, 654123.
%p A231228 b:= proc(u, o, t) option remember;
%p A231228       `if`(t=7, 0, `if`(u+o=0, `if`(t in [4, 5, 6], 1, 0),
%p A231228       add(b(u+j-1, o-j, [2, 5, 2, 5, 7, 5][t]), j=1..o)+
%p A231228       add(b(u-j, o+j-1, [1, 3, 4, 4, 6, 7][t]), j=1..u)))
%p A231228     end:
%p A231228 a:= n-> b(n, 0, 1):
%p A231228 seq(a(n), n=0..25);
%t A231228 b[u_, o_, t_] := b[u, o, t] = If[t==7, 0, If[u+o==0, If[4 <= t <= 6, 1, 0],
%t A231228       Sum[b[u + j - 1, o - j, {2, 5, 2, 5, 7, 5}[[t]]], {j, 1, o}] +
%t A231228       Sum[b[u - j, o + j - 1, {1, 3, 4, 4, 6, 7}[[t]]], {j, 1, u}]]];
%t A231228 a[n_] := b[n, 0, 1];
%t A231228 a /@ Range[0, 25] (* _Jean-François Alcover_, Jan 03 2021, after _Alois P. Heinz_ *)
%Y A231228 Column k=1 of A231210.
%K A231228 nonn
%O A231228 0,5
%A A231228 _Alois P. Heinz_, Nov 05 2013