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.

Showing 1-10 of 10 results.

A002054 Binomial coefficient C(2n+1, n-1).

Original entry on oeis.org

1, 5, 21, 84, 330, 1287, 5005, 19448, 75582, 293930, 1144066, 4457400, 17383860, 67863915, 265182525, 1037158320, 4059928950, 15905368710, 62359143990, 244662670200, 960566918220, 3773655750150, 14833897694226, 58343356817424, 229591913401900
Offset: 1

Views

Author

Keywords

Comments

a(n) = number of permutations in S_{n+2} containing exactly one 312 pattern. E.g., S_3 has a_1 = 1 permutations containing exactly one 312 pattern, and S_4 has a_2 = 5 permutations containing exactly one 312 pattern, namely 1423, 2413, 3124, 3142, and 4231. This comment is also true if 312 is replaced by any of 132, 213, or 231 (but not 123 or 321, for which see A003517). [Comment revised by N. J. A. Sloane, Nov 26 2022]
Number of valleys in all Dyck paths of semilength n+1. Example: a(2)=5 because UD*UD*UD, UD*UUDD, UUDD*UD, UUD*UDD, UUUDDD, where U=(1,1), D=(1,-1) and the valleys are shown by *. - Emeric Deutsch, Dec 05 2003
Number of UU's (double rises) in all Dyck paths of semilength n+1. Example: a(2)=5 because UDUDUD, UDU*UDD, U*UDDUD, U*UDUDD, U*U*UDDD, the double rises being shown by *. - Emeric Deutsch, Dec 05 2003
Number of peaks at level higher than one (high peaks) in all Dyck paths of semilength n+1. Example: a(2)=5 because UDUDUD, UDUU*DD, UU*DDUD, UU*DU*DD, UUU*DDD, the high peaks being shown by *. - Emeric Deutsch, Dec 05 2003
Number of diagonal dissections of a convex (n+3)-gon into n regions. Number of standard tableaux of shape (n,n,1) (see Stanley reference). - Emeric Deutsch, May 20 2004
Number of dissections of a convex (n+3)-gon by noncrossing diagonals into several regions, exactly n-1 of which are triangular. Example: a(2)=5 because the convex pentagon ABCDE is dissected by any of the diagonals AC, BD, CE, DA, EB into regions containing exactly 1 triangle. - Emeric Deutsch, May 31 2004
Number of jumps in all full binary trees with n+1 internal nodes. In the preorder traversal of a full binary tree, any transition from a node at a deeper level to a node on a strictly higher level is called a jump. - Emeric Deutsch, Jan 18 2007
a(n) is the total number of nonempty Dyck subpaths in all Dyck paths (A000108) of semilength n. For example, the Dyck path UUDUUDDD has Dyck subpaths stretching over positions 1-8 (the entire path), 2-3, 2-7, 4-7, 5-6 and so contributes 5 to a(4). - David Callan, Jul 25 2008
a(n+1) is the total number of ascents in the set of all n-permutations avoiding the pattern 132. For example, a(2) = 5 because there are 5 ascents in the set 123, 213, 231, 312, 321. - Cheyne Homberger, Oct 25 2013
Number of increasing tableaux of shape (n+1,n+1) with largest entry 2n+1. An increasing tableau is a semistandard tableau with strictly increasing rows and columns, and set of entries an initial segment of the positive integers. Example: a(2) = 5 counts the five tableaux (124)(235), (123)(245), (124)(345), (134)(245), (123)(245). - Oliver Pechenik, May 02 2014
a(n) is the number of noncrossing partitions of 2n+1 into n-1 blocks of size 2 and 1 block of size 3. - Oliver Pechenik, May 02 2014
Number of paths in the half-plane x>=0, from (0,0) to (2n+1,3), and consisting of steps U=(1,1) and D=(1,-1). For example, for n=2, we have the 5 paths: UUUUD, UUUDU, UUDUU, UDUUU, DUUUU. - José Luis Ramírez Ramírez, Apr 19 2015
From Gus Wiseman, Aug 20 2021: (Start)
Also the number of binary numbers with 2n+2 digits and with two more 0's than 1's. For example, the a(2) = 5 binary numbers are: 100001, 100010, 100100, 101000, 110000, with decimal values 33, 34, 36, 40, 48. Allowing first digit 0 gives A001791, ranked by A345910/A345912.
Also the number of integer compositions of 2n+2 with alternating sum -2, where the alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. For example, the a(3) = 21 compositions are:
(35) (152) (1124) (11141) (111113)
(251) (1223) (12131) (111212)
(1322) (13121) (111311)
(1421) (14111) (121112)
(2114) (121211)
(2213) (131111)
(2312)
(2411)
The following pertain to these compositions:
- The unordered version is A344741.
- Ranked by A345924 (reverse: A345923).
- A345197 counts compositions by length and alternating sum.
- A345925 ranks compositions with alternating sum 2 (reverse: A345922).
(End)

Examples

			G.f. = x + 5*x^2 + 21*x^3 + 84*x^4 + 330*x^5 + 1287*x^6 + 5005*x^7 + ...
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 828.
  • George Grätzer, General Lattice Theory. Birkhauser, Basel, 1998, 2nd edition, p. 474, line -3.
  • A. P. Prudnikov, Yu. A. Brychkov and O.I. Marichev, "Integrals and Series", Volume 1: "Elementary Functions", Chapter 4: "Finite Sums", New York, Gordon and Breach Science Publishers, 1986-1992.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Diagonal 4 of triangle A100257. Also a diagonal of A033282.
Equals (1/2) A024483(n+2). Bisection of A037951 and A037955.
Cf. A001263.
Column k=1 of A263771.
Counts terms of A031445 with 2n+2 digits in binary.
Cf. binomial(2*n+m, n): A000984 (m = 0), A001700 (m = 1), A001791 (m = 2), A002694 (m = 4), A003516 (m = 5), A002696 (m = 6), A030053 - A030056, A004310 - A004318.

Programs

  • GAP
    List([1..25],n->Binomial(2*n+1,n-1)); # Muniru A Asiru, Aug 09 2018
    
  • Magma
    [Binomial(2*n+1, n-1): n in [1..30]]; // Vincenzo Librandi, Apr 20 2015
    
  • Maple
    with(combstruct): seq((count(Composition(2*n+2), size=n)), n=1..24); # Zerinvary Lajos, May 03 2007
  • Mathematica
    CoefficientList[Series[8/(((Sqrt[1-4x] +1)^3)*Sqrt[1-4x]), {x,0,22}], x] (* Robert G. Wilson v, Aug 08 2011 *)
    a[ n_]:= Binomial[2 n + 1, n - 1]; (* Michael Somos, Apr 25 2014 *)
  • PARI
    {a(n) = binomial( 2*n+1, n-1)};
    
  • Python
    from _future_ import division
    A002054_list, b = [], 1
    for n in range(1,10**3):
        A002054_list.append(b)
        b = b*(2*n+2)*(2*n+3)//(n*(n+3)) # Chai Wah Wu, Jan 26 2016
    
  • Sage
    [binomial(2*n+1, n-1) for n in (1..25)] # G. C. Greubel, Mar 22 2019

Formula

a(n) = Sum_{j=0..n-1} binomial(2*j, j) * binomial(2*n - 2*j, n-j-1)/(j+1). - Yong Kong (ykong(AT)curagen.com), Dec 26 2000
G.f.: z*C^4/(2-C), where C=[1-sqrt(1-4z)]/(2z) is the Catalan function. - Emeric Deutsch, Jul 05 2003
From Wolfdieter Lang, Jan 09 2004: (Start)
a(n) = binomial(2*n+1, n-1) = n*C(n+1)/2, C(n)=A000108(n) (Catalan).
G.f.: (1 - 2*x - (1-3*x)*c(x))/(x*(1-4*x)) with g.f. c(x) of A000108. (End)
G.f.: z*C(z)^3/(1-2*z*C(z)), where C(z) is the g.f. of Catalan numbers. - José Luis Ramírez Ramírez, Apr 19 2015
G.f.: 2F1(5/2, 2; 4; 4*x). - R. J. Mathar, Aug 09 2015
D-finite with recurrence: a(n+1) = a(n)*(2*n+3)*(2*n+2)/(n*(n+3)). - Chai Wah Wu, Jan 26 2016
From Ilya Gutkovskiy, Aug 30 2016: (Start)
E.g.f.: (BesselI(0,2*x) + (1 - 1/x)*BesselI(1,2*x))*exp(2*x).
a(n) ~ 2^(2*n+1)/sqrt(Pi*n). (End)
a(n) = (1/(n+1))*Sum_{i=0..n-1} (n+1-i)*binomial(2n+2,i), n >= 1. - Taras Goy, Aug 09 2018
G.f.: (x - 1 + (1 - 3*x)/sqrt(1 - 4*x))/(2*x^2). - Michael Somos, Jul 28 2021
From Amiram Eldar, Jan 24 2022: (Start)
Sum_{n>=1} 1/a(n) = 5/3 - 2*Pi/(9*sqrt(3)).
Sum_{n>=1} (-1)^(n+1)/a(n) = 52*log(phi)/(5*sqrt(5)) - 7/5, where phi is the golden ratio (A001622). (End)
a(n) = A001405(2*n+1) - A000108(n+1), n >= 1 (from Eremin link, page 7). - Gennady Eremin, Sep 05 2023
G.f.: x/(1 - 4*x)^2 * c(-x/(1 - 4*x))^3, where c(x) = (1 - sqrt(1 - 4*x))/(2*x) is the g.f. of the Catalan numbers A000108. - Peter Bala, Feb 03 2024
From Peter Bala, Oct 13 2024: (Start)
a(n) = Integral_{x = 0..4} x^n * w(x) dx, where the weight function w(x) = 1/(2*Pi) * sqrt(x)*(x - 3)/sqrt(4 - x) (see Penson).
G.f. x*/sqrt(1 - 4*x) * c(x)^3. (End)

A246604 a(n) = Catalan(n) - n.

Original entry on oeis.org

1, 0, 0, 2, 10, 37, 126, 422, 1422, 4853, 16786, 58775, 208000, 742887, 2674426, 9694830, 35357654, 129644773, 477638682, 1767263171, 6564120400, 24466266999, 91482563618, 343059613627, 1289904147300, 4861946401427, 18367353072126, 69533550915977, 263747951750332, 1002242216651339
Offset: 0

Views

Author

Vincenzo Librandi, Aug 31 2014

Keywords

Crossrefs

All of A000108, A001453, A246604, A273526, A120304, A289615, A289616, A289652, A289653, A289654 are very similar sequences.

Programs

  • Magma
    [Catalan(n)-n: n in [0..30]];
  • Mathematica
    Table[(CatalanNumber[n] - n), {n, 0, 20}]

A051631 Triangle formed using Pascal's rule except begin and end n-th row with n-1.

Original entry on oeis.org

-1, 0, 0, 1, 0, 1, 2, 1, 1, 2, 3, 3, 2, 3, 3, 4, 6, 5, 5, 6, 4, 5, 10, 11, 10, 11, 10, 5, 6, 15, 21, 21, 21, 21, 15, 6, 7, 21, 36, 42, 42, 42, 36, 21, 7, 8, 28, 57, 78, 84, 84, 78, 57, 28, 8, 9, 36, 85, 135, 162, 168, 162, 135, 85, 36, 9
Offset: 0

Views

Author

Keywords

Comments

Row sums give A000918(n).
Central terms for n>0: T(2*n,n)=A024483(n+1), T(n,[n/2])=A116385(n-1); for n>1: T(n,1) = T(n,n-1) = A000217(n-2). - Reinhard Zumkeller, Nov 13 2011

Examples

			Triangle begins
  -1;
   0, 0;
   1, 0, 1;
   2, 1, 1, 2;
   3, 3, 2, 3, 3;
   4, 6, 5, 5, 6, 4; ...
		

Crossrefs

Cf. A007318.

Programs

  • Haskell
    a051631 n k = a051631_tabl !! n !! k
    a051631_row n = a051631_tabl !! n
    a051631_list = concat a051631_tabl
    a051631_tabl = iterate (\row -> zipWith (+) ([1] ++ row) (row ++[1])) [-1]
    -- Reinhard Zumkeller, Nov 13 2011
    
  • Magma
    /* As triangle */ [[Binomial(n+2,k+1) - 3*Binomial(n,k): k in [0..n]]: n in [0.. 10]]; // Vincenzo Librandi, Jan 11 2019
  • Mathematica
    Clear[t]; t[n_, k_] := t[n, k] = t[n-1, k] + t[n-1, k-1]; t[n_, 0] := n-1; t[n_, n_] := n-1; Table[t[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Apr 11 2013 *)

Formula

T(n,k) = T(n-1,k) + T(n-1,k-1), 0 < k < n, T(n,0) = T(n,n) = n - 1.
T(n,k) = C(n+2,k+1) - 3*C(n,k). - Charlie Neder, Jan 10 2019

Extensions

Definition modified and keyword tabl added by Reinhard Zumkeller, Nov 13 2011

A180266 a(0) = 0; a(n) = C(2*n-2,n-1)*(n^2-2*n+2)/n for n >= 1.

Original entry on oeis.org

0, 1, 2, 10, 50, 238, 1092, 4884, 21450, 92950, 398684, 1696396, 7171892, 30161740, 126293000, 526864680, 2191034970, 9086921190, 37596989100, 155232577500, 639749274780, 2632212288420, 10814090022840, 44369043365400
Offset: 0

Views

Author

Robert G. Wilson v, Aug 22 2010

Keywords

Comments

We may define Figurate Numbers F(r,n,d) with rank r, index n in dimension d as F(r,n,d) = binomial(r+d-2,d-1) *((r-1)*(n-2)+d) /d. These are polygonal numbers A057145 or A086271 in d=2, pyramidal numbers A080851 in d=3, and 4D pyramidal numbers A080852 in d=4, for example.
This sequence here is a(n) = F(n,n,n), the n-th n-gonal figurate number in n dimensions.
Limit_{n -> infinity} a(n+1)/a(n) = 4. - Robert G. Wilson v, Oct 30 2013

References

  • Albert H. Beiler, Recreations in the Theory of Numbers, The Queen of Mathematics Entertains, Second Edition, Dover, New York, 1966, Chptr. XVIII Ball Games, p. 196.

Crossrefs

Programs

  • Mathematica
    Figurate[ngon_, rank_, dim_] := Binomial[rank + dim - 2, dim - 1] ((rank - 1)*(ngon - 2) + dim)/dim; Table[ Figurate[n, n, n], {n, 50}]
    Join[{0},Table[Binomial[2n-2,n-1] (n^2-2n+2)/n,{n,30}]] (* Harvey P. Dale, Sep 22 2019 *)

Formula

a(n) = A000984(n-1) + (n-1)*A024483(n). [R. J. Mathar, Nov 18 2010]
From Ilya Gutkovskiy, Mar 29 2018: (Start)
O.g.f.: 1 - (1 - 7*x + 10*x^2)/(1 - 4*x)^(3/2).
E.g.f.: 1 - exp(2*x)*((1 - 3*x)*BesselI(0,2*x) + 2*x*BesselI(1,2*x)).
a(n) = [x^n] x*(1 - 3*x + n*x)/(1 - x)^(n+1). (End)

A103245 Triangle read by rows: T(n,k) = binomial(2n+1, n-k)*Fibonacci(2k+1), 0 <= k <= n.

Original entry on oeis.org

1, 3, 2, 10, 10, 5, 35, 42, 35, 13, 126, 168, 180, 117, 34, 462, 660, 825, 715, 374, 89, 1716, 2574, 3575, 3718, 2652, 1157, 233, 6435, 10010, 15015, 17745, 15470, 9345, 3495, 610, 24310, 38896, 61880, 80444, 80920, 60520, 31688, 10370, 1597, 92378
Offset: 0

Views

Author

Emeric Deutsch, Mar 19 2005

Keywords

Examples

			Triangle begins:
    1;
    3,   2;
   10,  10,   5;
   35,  42,  35,  13;
  126, 168, 180, 117,  34;
		

References

  • S. G. Guba, Problem No. 174, Issue No. 4, July-August 1965, p. 73 of Matematika v Skole.

Crossrefs

Column 0 is A001700.
Column 1 is A024483.
T(n, n) = A001519(n+1) (the odd-indexed Fibonacci numbers).
Row sums are the powers of 5 (A000351).
Alternating row sums yield A054108.

Programs

  • Maple
    with(combinat): T:=(n,k)->binomial(2*n+1,n-k)*fibonacci(2*k+1): for n from 0 to 9 do seq(T(n,k),k=0..n) od; # yields sequence in triangular form
  • Mathematica
    Table[Binomial[2 n + 1, n - k] Fibonacci[2 k + 1], {n, 0, 9}, {k, 0, n}] // Flatten (* Michael De Vlieger, Dec 01 2019 *)

Formula

T(n, k) = binomial(2n+1, n-k)*Fibonacci(2k+1), 0 <= k <= n.

A159255 Irregular triangle read by rows: row n gives expansion of (1-x+x^2)*(1+x)^n.

Original entry on oeis.org

1, -1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 2, 1, 1, 2, 1, 1, 3, 3, 2, 3, 3, 1, 1, 4, 6, 5, 5, 6, 4, 1, 1, 5, 10, 11, 10, 11, 10, 5, 1, 1, 6, 15, 21, 21, 21, 21, 15, 6, 1, 1, 7, 21, 36, 42, 42, 42, 36, 21, 7, 1, 1, 8, 28, 57, 78, 84, 84, 78, 57, 28, 8, 1, 1, 9, 36, 85, 135, 162, 168, 162, 135, 85, 36, 9, 1
Offset: 0

Views

Author

Philippe Deléham, Apr 07 2009

Keywords

Examples

			Row n=0 : 1, -1, 1 ;
Row n=1 : 1, 0, 0, 1 ;
Row n=2 : 1, 1, 0, 1, 1 ;
Row n=3 : 1, 2, 1, 1, 2, 1 ;
Row n=4 : 1, 3, 3, 2, 3, 3, 1 ;
Row n=5 : 1, 5, 10, 11, 10, 11, 10, 5, 1;
Row n=6 : 1, 6, 15, 21, 21, 21, 21, 15, 6, 1;
...
		

Crossrefs

Programs

  • PARI
    row(n)=Vecrev(polcoef((1 - y + y^2)/(1 - x*(1+y)) + O(x*x^n), n))
    { for(n=0, 10, print(row(n))) } \\ Andrew Howroyd, Mar 03 2023

Formula

G.f.: A(x,y) = (1 - y + y^2)/(1 - x*(1+y)). - Andrew Howroyd, Mar 03 2023

A246574 a(n) = 2*(n-1)*Catalan(n).

Original entry on oeis.org

0, 4, 20, 84, 336, 1320, 5148, 20020, 77792, 302328, 1175720, 4576264, 17829600, 69535440, 271455660, 1060730100, 4148633280, 16239715800, 63621474840, 249436575960, 978650680800, 3842267672880, 15094623000600, 59335590776904, 233373427269696
Offset: 1

Views

Author

N. J. A. Sloane, Aug 30 2014

Keywords

Crossrefs

Programs

  • Magma
    [2*(n-1)*Catalan(n): n in [1..30]]; // Vincenzo Librandi, Aug 31 2014
  • Mathematica
    Table[2 (CatalanNumber[n] (n - 1)), {n, 1, 30}] (* Vincenzo Librandi, Aug 31 2014 *)

A276666 a(n) = (n-1)*Catalan(n).

Original entry on oeis.org

-1, 0, 2, 10, 42, 168, 660, 2574, 10010, 38896, 151164, 587860, 2288132, 8914800, 34767720, 135727830, 530365050, 2074316640, 8119857900, 31810737420, 124718287980, 489325340400, 1921133836440, 7547311500300, 29667795388452, 116686713634848, 459183826803800
Offset: 0

Views

Author

Peter Luschny, Sep 12 2016

Keywords

Crossrefs

A024483 is a variant of this sequence.

Programs

  • GAP
    Concatenation([-1], List([1..30], n-> 2*Binomial(2*n-1, n+1))); # G. C. Greubel, Aug 29 2019
  • Magma
    [(n-1)*Catalan(n): n in [0..30]]; // Vincenzo Librandi, Sep 13 2016
    
  • Maple
    f := (1-3*x)/(x*sqrt(1-4*x))-1/x:
    series(f,x,29): seq(coeff(%,x,n), n=0..26);
    A276666 := n -> (n^2-1)*(2*n)!/(n+1)!^2:
    seq(A276666(n), n=0..26);
  • Mathematica
    Table[(n - 1) CatalanNumber[n], {n, 0, 30}] (* Vincenzo Librandi, Sep 13 2016 *)
  • PARI
    a(n) = if(n==0,-1, 2*binomial(2*n-1, n+1)); \\ G. C. Greubel, Aug 29 2019
    
  • Sage
    A276666 = lambda n: (n - 1) * catalan_number(n)
    [A276666(n) for n in range(27)]
    

Formula

a(n) = [x^n] (1-3*x)/(x*sqrt(1-4*x))-1/x.
a(n) = 4^n*(n-1)*hypergeom([3/2, -n], [2], 1).
a(n) = 4^n*(n-1)*JacobiP(n,1,-1/2-n,-1)/(n+1).
a(n) = (2*n)! [x^(2^n)]( BesselI(2,2*x) - (1+1/x)*BesselI(1,2*x) ).
a(n) = binomial(2*n,n) - 2*Catalan(n). (See Geoffrey Critzer's formula in A024483).
a(n) = A056040(2*n) - 2*A057977(2*n).
a(n) = A056040(2*n)*(1-2/(n+1)) = (n^2-1)*(2*n)!/(n+1)!^2.
a(n) = A232500(2*n).
a(n) = a(n-1)*2*(n-1)*(2*n-1)/((n-2)*(n+1)) for n > 2. - Chai Wah Wu, Sep 12 2016
a(n) = A024483(n+1) for n>0. - R. J. Mathar, Sep 13 2016
a(n) = A000984(n+1)-3*A000984(n). - Ezhilarasu Velayutham, Aug 27 2019
From Amiram Eldar, Mar 22 2022: (Start)
Sum_{n>=2} 1/a(n) = 5/6 - Pi/(9*sqrt(3)).
Sum_{n>=2} (-1)^n/a(n) = 26*sqrt(5)*log(phi)/25 - 7/10, where phi is the golden ratio (A001622). (End)

A217234 Triangle of expansion coefficients of the sum of an n X n array with equal top row and left column (extended by the rule of Pascal's triangle) in terms of the top row elements.

Original entry on oeis.org

1, 1, 4, 1, 12, 6, 1, 40, 20, 8, 1, 140, 70, 30, 10, 1, 504, 252, 112, 42, 12, 1, 1848, 924, 420, 168, 56, 14, 1, 6864, 3432, 1584, 660, 240, 72, 16, 1, 25740, 12870, 6006, 2574, 990, 330, 90, 18, 1, 97240, 48620, 22880, 10010, 4004, 1430, 440, 110, 20
Offset: 1

Views

Author

J. M. Bergot, Sep 28 2012

Keywords

Comments

Define a finite n X n square array with indeterminate elements A(1, c), c=1..n in the top row, the same elements A(r,1 ) = A(1,r) in the first column, r=1..n, and the remaining elements defined by the Pascal triangle rule: A(r,c) = A(r,c-1)+A(r-1,c).
The triangle T(n,m) gives the coefficients in the formula Sum_{r=1..n} Sum_{c=1..n} A(r,c) = Sum_{m=1..n} T(n,m) * A(1,m).
It says how many times the first, second, third, etc. element of the first row (or the first column) contributes to the sum of the n X n array.

Examples

			1;
1,4;
1,12,6;
1,40,20,8;
1,140,70,30,10;
1,504,252,112,42,12;
1,1848,924,420,168,56,14;
1,6864,3432,1584,660,240,72,16;
1,25740,12870,6006,2574,990,330,90,18;
1,97240,48620,22880,10010,4004,1430,440,110,20;
		

Crossrefs

Cf. A100320 (2nd column), A000984 (third column), A162551 (third column), A024483 (4th column), A006659 (5th column), A002058 (6th column), A030662 (row sums).

Programs

  • Maple
    A217234_row := proc(n)
        local A,r,c,s ;
        A := array({},1..n,1..n) ;
        for r from 2 to n do
            A[r,1] := A[1,r] ;
        end do:
        for r from 2 to n do
            for c from 2 to n do
                A[r,c] := A[r,c-1]+A[r-1,c] ;
            end do:
        end do:
        s := add(add( A[r,c],c=1..n) ,r=1..n) ;
        for c from 1 to n do
            printf("%d,", coeff(s,A[1,c]) ) ;
        end do:
        return ;
    end proc:
    for n from 1 to 10 do
        A217234_row(n) ;
        printf(";\n") ;
    end do; # R. J. Mathar, Oct 13 2012
  • Mathematica
    A217234row [n_] := Module[{A, x, r, c, s }, A = Array[x, {n, n}]; Do[A[[r, 1]] = A[[1, r]], {r, 2, n}]; Do[A[[r, c]] = A[[r, c - 1]] + A[[r - 1, c]], {r, 2, n}, {c, 2, n}]; s = Sum[A[[r, c]], {r, 1, n}, {c, 1, n}]; If[n == 1, {1}, List @@ s /. x[, ] -> 1]];
    Table[A217234row[n], {n, 1, 10}] // Flatten (* Jean-François Alcover, Nov 04 2023, after R. J. Mathar *)

Extensions

Edited by R. J. Mathar, Oct 13 2012
Typo in data corrected by Jean-François Alcover, Nov 04 2023

A337500 a(n) is the number of ballot sequences of length n tied or won by at most 3 votes.

Original entry on oeis.org

1, 2, 4, 8, 14, 30, 50, 112, 182, 420, 672, 1584, 2508, 6006, 9438, 22880, 35750, 87516, 136136, 335920, 520676, 1293292, 1998724, 4992288, 7696444, 19315400, 29716000, 74884320, 115000920, 290845350, 445962870
Offset: 0

Views

Author

Nachum Dershowitz, Aug 30 2020

Keywords

Comments

Also the number of n-step walks on a path graph ending within 3 steps of the origin.
Also the number of monotonic paths of length n ending within 3 steps of the diagonal.

Crossrefs

Bisections give A162551 (odd part, starting from second element), A051924 (even part).

Formula

a(n) = A337499(n) + (n mod 2)*A024483(floor((n+3)/2)).
Conjecture: D-finite with recurrence -(n+3)*(n-4)*a(n) +2*(n^2-2*n-11)*a(n-1) +4*(n-1)^2*a(n-2) -8*(n-1)*(n-2)*a(n-3)=0. - R. J. Mathar, Sep 27 2020
Showing 1-10 of 10 results.