OFFSET
1,4
COMMENTS
This is well-defined because for all patterns alpha in S_3 the number of permutations in S_n avoiding alpha is the same (the Catalan numbers). - Emeric Deutsch, May 05 2008
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..170
FindStat - Combinatorial Statistic Finder, The number of occurrences of the pattern [1,2,3] inside a permutation of length at least 3, The number of occurrences of the pattern [1,3,2] in a permutation, The number of occurrences of the pattern [2,1,3] in a permutation, The number of occurrences of the pattern [2,3,1] in a permutation, The number of occurrences of the pattern [3,1,2] in a permutation
R. Simion and F. W. Schmidt, Restricted permutations, European J. Combin., 6, pp. 383-406, 1985.
Eric Weisstein's World of Mathematics, Permutation Pattern
FORMULA
From Alois P. Heinz, Jul 05 2012: (Start)
a(n) = A214152(n, 3).
E.g.f.: 1/(1 - x) - exp(2*x)*(BesselI(0,2*x) - BesselI(1,2*x)). - Ilya Gutkovskiy, Jan 21 2017
EXAMPLE
a(4) = 10 because, taking, for example, the pattern alpha=321, we have 3214, 3241, 1432, 2431, 3421, 4213, 4132, 4231, 4312 and 4321.
MAPLE
a:= n-> n! -binomial(2*n, n)/(n+1):
seq(a(n), n=1..25); # Alois P. Heinz, Jul 05 2012
MATHEMATICA
Table[n! -CatalanNumber[n], {n, 30}]
PROG
(PARI) a(n)=n!-binomial(n+n, n+1)/n \\ Charles R Greathouse IV, Jun 10 2011
(Magma)
A056986:= func< n | Factorial(n) - Catalan(n) >;
[A056986(n): n in [1..30]]; // G. C. Greubel, Oct 06 2024
(SageMath)
def A056986(n): return factorial(n) - catalan_number(n)
[A056986(n) for n in range(1, 31)] # G. C. Greubel, Oct 06 2024
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
STATUS
approved