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.

A238979 Number of ballot sequences of length n with exactly 4 fixed points.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 3, 9, 29, 98, 350, 1302, 5062, 20380, 85108, 366444, 1627836, 7430360, 34855016, 167546408, 825185448, 4155400720, 21388745008, 112355110672, 602103194448, 3287743832352, 18285157048544, 103480813034336, 595671084096608, 3485006638408128
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 07 2014

Keywords

Comments

The fixed points are in the first 4 positions.
Also the number of standard Young tableaux with n cells such that the first column contains 1, 2, 3, and 4, but not 5. An alternate definition uses the first row.
Conjecture: Generally, for fixed k is column k of A238802 asymptotic to sqrt(2)/(2*(k+1)*(k-1)!) * exp(sqrt(n)-n/2-1/4) * n^(n/2) * (1 + 7/(24*sqrt(n))), holds for all k<=10. - Vaclav Kotesovec, Mar 08 2014

Examples

			a(4) = 1: [1,2,3,4].
a(5) = 1: [1,2,3,4,1].
a(6) = 3: [1,2,3,4,1,1], [1,2,3,4,1,2], [1,2,3,4,1,5].
a(7) = 9: [1,2,3,4,1,1,1], [1,2,3,4,1,1,2], [1,2,3,4,1,1,5], [1,2,3,4,1,2,1], [1,2,3,4,1,2,3], [1,2,3,4,1,2,5], [1,2,3,4,1,5,1], [1,2,3,4,1,5,2], [1,2,3,4,1,5,6].
		

Crossrefs

Column k=4 of A238802.

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<3, [1$2, 3][n+1],
          ((11-n)*b(n-1) +(n^3+4*n^2-15)*b(n-2)
           +(n-1)*(n-3)*(n+7)*b(n-3))/((n-1)*(n+1)))
        end:
    a:= n-> `if`(n<4, 0, b(n-4)):
    seq(a(n), n=0..40);
  • Mathematica
    b[n_, l_List] := b[n, l] = If[n <= 0, 1, b[n - 1, Append[l, 1]] + Sum[If[i == 1 || l[[i - 1]] > l[[i]], b[n - 1, ReplacePart[l, i -> l[[i]] + 1]], 0], {i, 1, Length[l]}]]; a[n_] := If[n == 4, 1, b[n - 5, {2, 1, 1, 1}]]; a[n_ /; n < 4] = 0; Table[Print["a(", n, ") = ", an = a[n]]; an, {n, 0, 40}] (* Jean-François Alcover, Feb 06 2015, after Maple *)

Formula

See Maple program.
a(n) ~ sqrt(2)/60 * exp(sqrt(n)-n/2-1/4) * n^(n/2) * (1 + 7/(24*sqrt(n))). - Vaclav Kotesovec, Mar 07 2014
Recurrence (for n>=6): (n-5)*(n^4 - 15*n^3 + 65*n^2 - 45*n + 54)*a(n) = (n^5 - 20*n^4 + 125*n^3 - 145*n^2 - 651*n + 810)*a(n-1) + (n-6)*(n-4)*(n^4 - 11*n^3 + 26*n^2 + 44*n + 60)*a(n-2). - Vaclav Kotesovec, Mar 08 2014