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 14 results. Next

A218008 Sum of successive absolute differences of the binomial coefficients = 2*A014495(n).

Original entry on oeis.org

0, 0, 2, 4, 10, 18, 38, 68, 138, 250, 502, 922, 1846, 3430, 6862, 12868, 25738, 48618, 97238, 184754, 369510, 705430, 1410862, 2704154, 5408310, 10400598, 20801198, 40116598, 80233198, 155117518, 310235038
Offset: 0

Views

Author

Olivier Gérard, Oct 18 2012

Keywords

Crossrefs

Cf. Row sums of absolute values of A214292

Programs

Formula

a(n) = sum |C(n,k+1)-C(n,k)|, k=0..n-1 = 2*sum C(n,k+1)-C(n,k), k=0..floor((n-1)/2) = 2*(C(n, floor((n+1)/2)) - 1)

A009766 Catalan's triangle T(n,k) (read by rows): each term is the sum of the entries above and to the left, i.e., T(n,k) = Sum_{j=0..k} T(n-1,j).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 3, 5, 5, 1, 4, 9, 14, 14, 1, 5, 14, 28, 42, 42, 1, 6, 20, 48, 90, 132, 132, 1, 7, 27, 75, 165, 297, 429, 429, 1, 8, 35, 110, 275, 572, 1001, 1430, 1430, 1, 9, 44, 154, 429, 1001, 2002, 3432, 4862, 4862, 1, 10, 54, 208, 637, 1638, 3640, 7072, 11934
Offset: 0

Views

Author

Keywords

Comments

The entries in this triangle (in its many forms) are often called ballot numbers.
T(n,k) = number of standard tableaux of shape (n,k) (n > 0, 0 <= k <= n). Example: T(3,1) = 3 because we have 134/2, 124/3 and 123/4. - Emeric Deutsch, May 18 2004
T(n,k) is the number of full binary trees with n+1 internal nodes and jump-length k. 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; the positive difference of the levels is called the jump distance; the sum of the jump distances in a given ordered tree is called the jump-length. - Emeric Deutsch, Jan 18 2007
The k-th diagonal from the right (k=1, 2, ...) gives the sequence obtained by asking in how many ways can we toss a fair coin until we first get k more heads than tails. The k-th diagonal has formula k(2m+k-1)!/(m!(m+k)!) and g.f. (C(x))^k where C(x) is the generating function for the Catalan numbers, (1-sqrt(1-4*x))/(2*x). - Anthony C Robin, Jul 12 2007
T(n,k) is also the number of order-decreasing and order-preserving full transformations (of an n-element chain) of waist k (waist (alpha) = max(Im(alpha))). - Abdullahi Umar, Aug 25 2008
Formatted as an upper right triangle (see tables) a(c,r) is the number of different triangulated planar polygons with c+2 vertices, with triangle degree c-r+1 for the same vertex X (c=column number, r=row number, with c >= r >= 1). - Patrick Labarque, Jul 28 2010
The triangle sums, see A180662 for their definitions, link Catalan's triangle, its mirror is A033184, with several sequences, see crossrefs. - Johannes W. Meijer, Sep 22 2010
The m-th row of Catalan's triangle consists of the unique nonnegative differences of the form binomial(m+k,m)-binomial(m+k,m+1) with 0 <= k <= m (See Links). - R. J. Cano, Jul 22 2014
T(n,k) is also the number of nondecreasing parking functions of length n+1 whose maximum element is k+1. For example T(3,2) = 5 because we have (1,1,1,3), (1,1,2,3), (1,2,2,3), (1,1,3,3), (1,2,3,3). - Ran Pan, Nov 16 2015
T(n,k) is the number of Dyck paths from (0,0) to (n+2,n+2) which start with n-k+2 east steps and touch the diagonal y=x only on the last north step. - Felipe Rueda, Sep 18 2019
T(n-1,k) for k < n is number of well-formed strings of n parenthesis pairs with prefix of exactly n-k opening parenthesis; T(n,n) = T(n,n-1). - Hermann Stamm-Wilbrandt, May 02 2021

Examples

			Triangle begins in row n=0 with 0 <= k <= n:
  1;
  1, 1;
  1, 2,  2;
  1, 3,  5,   5;
  1, 4,  9,  14,  14;
  1, 5, 14,  28,  42,   42;
  1, 6, 20,  48,  90,  132,  132;
  1, 7, 27,  75, 165,  297,  429,  429;
  1, 8, 35, 110, 275,  572, 1001, 1430, 1430;
  1, 9, 44, 154, 429, 1001, 2002, 3432, 4862, 4862;
		

References

  • William Feller, Introduction to Probability Theory and its Applications, vol. I, ed. 2, chap. 3, sect. 1,2.
  • Ki Hang Kim, Douglas G. Rogers, and Fred W. Roush, Similarity relations and semiorders. Proceedings of the Tenth Southeastern Conference on Combinatorics, Graph Theory and Computing (Florida Atlantic Univ., Boca Raton, Fla., 1979), pp. 577-594, Congress. Numer., XXIII-XXIV, Utilitas Math., Winnipeg, Man., 1979. MR0561081 (81i:05013).
  • D. E. Knuth, TAOCP, Vol. 4, Section 7.2.1.6, Eq. 22, p. 451.
  • C. Krishnamachary and M. Bheemasena Rao, Determinants whose elements are Eulerian, prepared Bernoullian and other numbers, J. Indian Math. Soc., 14 (1922), 55-62, 122-138 and 143-146.
  • M. Bellon, Query 5467, L'Intermédiaire des Mathématiciens, 4 (1925), 11; H. Ory, 4 (1925), 120. - N. J. A. Sloane, Mar 09 2022
  • Andrzej Proskurowski and Ekaputra Laiman, Fast enumeration, ranking, and unranking of binary trees. Proceedings of the thirteenth Southeastern conference on combinatorics, graph theory and computing (Boca Raton, Fla., 1982). Congr. Numer. 35 (1982), 401-413.MR0725898 (85a:68152).
  • M. Welsch, Note #371, L'Intermédiaire des Mathématiciens, 2 (1895), pp. 235-237. - N. J. A. Sloane, Mar 02 2022

Crossrefs

The following are all versions of (essentially) the same Catalan triangle: A009766, A008315, A028364, A030237, A047072, A053121, A059365, A062103, A099039, A106566, A130020, A140344.
Sums of the shallow diagonals give A001405, central binomial coefficients: 1=1, 1=1, 1+1=2, 1+2=3, 1+3+2=6, 1+4+5=10, 1+5+9+5=20, ...
Row sums as well as the sums of the squares of the shallow diagonals give Catalan numbers (A000108).
Reflected version of A033184.
Triangle sums (see the comments): A000108 (Row1), A000957 (Row2), A001405 (Kn11), A014495 (Kn12), A194124 (Kn13), A030238 (Kn21), A000984 (Kn4), A000958 (Fi2), A165407 (Ca1), A026726 (Ca4), A081696 (Ze2).

Programs

  • GAP
    Flat(List([0..10],n->List([0..n],m->Binomial(n+m,n)*(n-m+1)/(n+1)))); # Muniru A Asiru, Feb 18 2018
    
  • Haskell
    a009766 n k = a009766_tabl !! n !! k
    a009766_row n = a009766_tabl !! n
    a009766_tabl = iterate (\row -> scanl1 (+) (row ++ [0])) [1]
    -- Reinhard Zumkeller, Jul 12 2012
    
  • Magma
    [[Binomial(n+k,n)*(n-k+1)/(n+1): k in [0..n]]: n in [0..10]]; // G. C. Greubel, Mar 07 2019
    
  • Maple
    A009766 := proc(n,k) binomial(n+k,n)*(n-k+1)/(n+1); end proc:
    seq(seq(A009766(n,k), k=0..n), n=0..10); # R. J. Mathar, Dec 03 2010
  • Mathematica
    Flatten[NestList[Append[Accumulate[#], Last[Accumulate[#]]] &, {1}, 9]] (* Birkas Gyorgy, May 19 2012 *)
    T[n_, k_] := T[n, k] = Which[k == 0, 1, k>n, 0, True, T[n-1, k] + T[n, k-1] ]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Mar 07 2016 *)
  • PARI
    {T(n, k) = if( k<0 || k>n, 0, binomial(n+1+k, k) * (n+1-k) / (n+1+k) )}; /* Michael Somos, Oct 17 2006 */
    
  • PARI
    b009766=(n1=0,n2=100)->{my(q=if(!n1,0,binomial(n1+1,2)));for(w=n1,n2,for(k=0,w,write("b009766.txt",1*q" "1*(binomial(w+k,w)-binomial(w+k,w+1)));q++))} \\ R. J. Cano, Jul 22 2014
    
  • Python
    from math import comb, isqrt
    def A009766(n): return comb((a:=(m:=isqrt(k:=n+1<<1))-(k<=m*(m+1)))+(b:=n-comb(a+1,2)),b)*(a-b+1)//(a+1) # Chai Wah Wu, Nov 12 2024
  • Sage
    @CachedFunction
    def ballot(p,q):
        if p == 0 and q == 0: return 1
        if p < 0 or p > q: return 0
        S = ballot(p-2, q) + ballot(p, q-2)
        if q % 2 == 1: S += ballot(p-1, q-1)
        return S
    A009766 = lambda n, k: ballot(2*k, 2*n)
    for n in (0..7): [A009766(n, k) for k in (0..n)]  # Peter Luschny, Mar 05 2014
    
  • Sage
    [[binomial(n+k,n)*(n-k+1)/(n+1) for k in (0..n)] for n in (0..10)] # G. C. Greubel, Mar 07 2019
    

Formula

T(n, m) = binomial(n+m, n)*(n-m+1)/(n+1), 0 <= m <= n.
G.f. for column m: (x^m)*N(2; m-1, x)/(1-x)^(m+1), m >= 0, with the row polynomials from triangle A062991 and N(2; -1, x) := 1.
G.f.: C(t*x)/(1-x*C(t*x)) = 1 + (1+t)*x + (1+2*t+2*t^2)*x^2 + ..., where C(x) = (1-sqrt(1-4*x))/(2*x) is the Catalan function. - Emeric Deutsch, May 18 2004
Another version of triangle T(n, k) given by [1, 0, 0, 0, 0, 0, ...] DELTA [0, 1, 1, 1, 1, 1, 1, ...] = 1; 1, 0; 1, 1, 0; 1, 2, 2, 0; 1, 3, 5, 5, 0; 1, 4, 9, 14, 14, 0; ... where DELTA is the operator defined in A084938. - Philippe Deléham, Feb 16 2005
O.g.f. (with offset 1) is the series reversion of x*(1+x*(1-t))/(1+x)^2 = x - x^2*(1+t) + x^3*(1+2*t) - x^4*(1+3*t) + ... . - Peter Bala, Jul 15 2012
Sum_{k=0..floor(n/2)} T(n-k+p-1, k+p-1) = A001405(n+2*p-2) - C(n+2*p-2, p-2), p >= 1. - Johannes W. Meijer, Oct 03 2013
Let A(x,t) denote the o.g.f. Then 1 + x*d/dx(A(x,t))/A(x,t) = 1 + (1 + t)*x + (1 + 2*t + 3*t^2)*x^2 + (1 + 3*t + 6*t^2 + 10*t^3)*x^3 + ... is the o.g.f. for A059481. - Peter Bala, Jul 21 2015
The n-th row polynomial equals the n-th degree Taylor polynomial of the function (1 - 2*x)/(1 - x)^(n+2) about 0. For example, for n = 4, (1 - 2*x)/(1 - x)^6 = 1 + 4*x + 9*x^2 + 14*x^3 + 14*x^4 + O(x^5). - Peter Bala, Feb 18 2018
T(n,k) = binomial(n + k + 1, k) - 2*binomial(n + k, k - 1), for 0 <= k <= n. - David Callan, Jun 15 2022

A058622 a(n) = 2^(n-1) - ((1+(-1)^n)/4)*binomial(n, n/2).

Original entry on oeis.org

0, 1, 1, 4, 5, 16, 22, 64, 93, 256, 386, 1024, 1586, 4096, 6476, 16384, 26333, 65536, 106762, 262144, 431910, 1048576, 1744436, 4194304, 7036530, 16777216, 28354132, 67108864, 114159428, 268435456, 459312152, 1073741824, 1846943453
Offset: 0

Views

Author

Yong Kong (ykong(AT)curagen.com), Dec 29 2000

Keywords

Comments

a(n) is the number of n-digit binary sequences that have more 1's than 0's. - Geoffrey Critzer, Jul 16 2009
Maps to the number of walks that end above 0 on the number line with steps being 1 or -1. - Benjamin Phillabaum, Mar 06 2011
Chris Godsil observes that a(n) is the independence number of the (n+1)-folded cube graph; proof is by a Cvetkovic's eigenvalue bound to establish an upper bound and a direct construction of the independent set by looking at vertices at an odd (resp., even) distance from a fixed vertex when n is odd (resp., even). - Stan Wagon, Jan 29 2013
Also the number of subsets of {1,2,...,n} that contain more odd than even numbers. For example, for n=4, a(4)=5 and the 5 subsets are {1}, {3}, {1,3}, {1,2,3}, {1,3,4}. See A014495 when same number of even and odd numbers. - Enrique Navarrete, Feb 10 2018
Also half the number of length-n binary sequences with a different number of zeros than ones. This is also the number of integer compositions of n with nonzero alternating sum, where the alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. Also the number of integer compositions of n+1 with alternating sum <= 0, ranked by A345915 (reverse: A345916). - Gus Wiseman, Jul 19 2021

Examples

			G.f. = x + x^2 + 4*x^3 + 5*x^4 + 16*x^5 + 22*x^6 + 64*x^7 + 93*x^8 + ...
From _Gus Wiseman_, Jul 19 2021: (Start)
The a(1) = 1 through a(5) = 16 compositions with nonzero alternating sum:
  (1)  (2)  (3)      (4)      (5)
            (1,2)    (1,3)    (1,4)
            (2,1)    (3,1)    (2,3)
            (1,1,1)  (1,1,2)  (3,2)
                     (2,1,1)  (4,1)
                              (1,1,3)
                              (1,2,2)
                              (1,3,1)
                              (2,1,2)
                              (2,2,1)
                              (3,1,1)
                              (1,1,1,2)
                              (1,1,2,1)
                              (1,2,1,1)
                              (2,1,1,1)
                              (1,1,1,1,1)
(End)
		

References

  • 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, Eq. (4.2.1.7)

Crossrefs

The odd bisection is A000302.
The even bisection is A000346.
The following relate to compositions with nonzero alternating sum:
- The complement is counted by A001700 or A138364.
- The version for alternating sum > 0 is A027306.
- The unordered version is A086543 (even bisection: A182616).
- The version for alternating sum < 0 is A294175.
- These compositions are ranked by A345921.
A011782 counts compositions.
A097805 counts compositions by alternating (or reverse-alternating) sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A345197 counts compositions by length and alternating sum.
Compositions of n, 2n, or 2n+1 with alternating/reverse-alternating sum k:
- k = 0: counted by A088218, ranked by A344619/A344619.
- k = 1: counted by A000984, ranked by A345909/A345911.
- k = -1: counted by A001791, ranked by A345910/A345912.
- k = 2: counted by A088218, ranked by A345925/A345922.
- k = -2: counted by A002054, ranked by A345924/A345923.
- k >= 0: counted by A116406, ranked by A345913/A345914.
- k > 0: counted by A027306, ranked by A345917/A345918.
- k < 0: counted by A294175, ranked by A345919/A345920.
- k even: counted by A081294, ranked by A053754/A053754.
- k odd: counted by A000302, ranked by A053738/A053738.

Programs

  • Magma
    [(2^n -(1+(-1)^n)*Binomial(n, Floor(n/2))/2)/2: n in [0..40]]; // G. C. Greubel, Aug 08 2022
    
  • Mathematica
    Table[Sum[Binomial[n, Floor[n/2 + i]], {i, 1, n}], {n, 0, 32}] (* Geoffrey Critzer, Jul 16 2009 *)
    a[n_] := If[n < 0, 0, (2^n - Boole[EvenQ @ n] Binomial[n, Quotient[n, 2]])/2]; (* Michael Somos, Nov 22 2014 *)
    a[n_] := If[n < 0, 0, n! SeriesCoefficient[(Exp[2 x] - BesselI[0, 2 x])/2, {x, 0, n}]]; (* Michael Somos, Nov 22 2014 *)
    Table[2^(n - 1) - (1 + (-1)^n) Binomial[n, n/2]/4, {n, 0, 40}] (* Eric W. Weisstein, Mar 21 2018 *)
    CoefficientList[Series[2 x/((1-2x)(1 + 2x + Sqrt[(1+2x)(1-2x)])), {x, 0, 40}], x] (* Eric W. Weisstein, Mar 21 2018 *)
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],ats[#]!=0&]],{n,0,15}] (* Gus Wiseman, Jul 19 2021 *)
  • PARI
    a(n) = 2^(n-1) - ((1+(-1)^n)/4)*binomial(n, n\2); \\ Michel Marcus, Dec 30 2015
    
  • PARI
    my(x='x+O('x^100)); concat(0, Vec(2*x/((1-2*x)*(1+2*x+((1+2*x)*(1-2*x))^(1/2))))) \\ Altug Alkan, Dec 30 2015
    
  • Python
    from math import comb
    def A058622(n): return (1<>1)>>1) if n else 0 # Chai Wah Wu, Aug 25 2025
  • SageMath
    [(2^n - binomial(n, n//2)*((n+1)%2))/2 for n in (0..40)] # G. C. Greubel, Aug 08 2022
    

Formula

a(n) = 2^(n-1) - ((1+(-1)^n)/4)*binomial(n, n/2).
a(n) = Sum_{i=0..floor((n-1)/2)} binomial(n, i).
G.f.: 2*x/((1-2*x)*(1+2*x+((1+2*x)*(1-2*x))^(1/2))). - Vladeta Jovovic, Apr 27 2003
E.g.f: (e^(2x)-I_0(2x))/2 where I_n is the Modified Bessel Function. - Benjamin Phillabaum, Mar 06 2011
Logarithmic derivative of the g.f. of A210736 is a(n+1). - Michael Somos, Nov 22 2014
Even index: a(2n) = 2^(n-1) - A088218(n). Odd index: a(2n+1) = 2^(2n). - Gus Wiseman, Jul 19 2021
D-finite with recurrence n*a(n) +2*(-n+1)*a(n-1) +4*(-n+1)*a(n-2) +8*(n-2)*a(n-3)=0. - R. J. Mathar, Sep 23 2021
a(n) = 2^n-A027306(n). - R. J. Mathar, Sep 23 2021
A027306(n) - a(n) = A126869(n). - R. J. Mathar, Sep 23 2021

A214292 Triangle read by rows: T(n,k) = T(n-1,k-1) + T(n-1,k), 0 < k < n with T(n,0) = n and T(n,n) = -n.

Original entry on oeis.org

0, 1, -1, 2, 0, -2, 3, 2, -2, -3, 4, 5, 0, -5, -4, 5, 9, 5, -5, -9, -5, 6, 14, 14, 0, -14, -14, -6, 7, 20, 28, 14, -14, -28, -20, -7, 8, 27, 48, 42, 0, -42, -48, -27, -8, 9, 35, 75, 90, 42, -42, -90, -75, -35, -9, 10, 44, 110, 165, 132, 0, -132, -165, -110, -44, -10
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 12 2012

Keywords

Examples

			The triangle begins:
    0:                              0
    1:                            1   -1
    2:                          2   0   -2
    3:                       3    2   -2   -3
    4:                     4    5   0   -5   -4
    5:                  5    9    5   -5   -9   -5
    6:                6   14   14   0  -14  -14   -6
    7:             7   20   28   14  -14  -28  -20   -7
    8:           8   27   48   42   0  -42  -48  -27   -8
    9:        9   35   75   90   42  -42  -90  -75  -35   -9
   10:     10   44  110  165  132   0 -132 -165 -110  -44  -10
   11:  11   54  154  275  297  132 -132 -297 -275 -154  -54  -11  .
		

Crossrefs

Programs

  • Haskell
    a214292 n k = a214292_tabl !! n !! k
    a214292_row n = a214292_tabl !! n
    a214292_tabl = map diff $ tail a007318_tabl
       where diff row = zipWith (-) (tail row) row
  • Mathematica
    row[n_] := Table[Binomial[n, k], {k, 0, n}] // Differences;
    T[n_, k_] := row[n + 1][[k + 1]];
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 31 2018 *)

Formula

T(n,k) = A007318(n+1,k+1) - A007318(n+1,k), 0<=k<=n, i.e. first differences of rows in Pascal's triangle;
T(n,k) = -T(n,k);
row sums and central terms equal 0, cf. A000004;
sum of positive elements of n-th row = A014495(n+1);
T(n,0) = n;
T(n,1) = A000096(n-2) for n > 1; T(n,1) = - A080956(n) for n > 0;
T(n,2) = A005586(n-4) for n > 3; T(n,2) = A129936(n-2);
T(n,3) = A005587(n-6) for n > 5;
T(n,4) = A005557(n-9) for n > 8;
T(n,5) = A064059(n-11) for n > 10;
T(n,6) = A064061(n-13) for n > 12;
T(n,7) = A124087(n) for n > 14;
T(n,8) = A124088(n) for n > 16;
T(2*n+1,n) = T(2*n+2,n) = A000108(n+1), Catalan numbers;
T(2*n+3,n) = A000245(n+2);
T(2*n+4,n) = A002057(n+1);
T(2*n+5,n) = A000344(n+3);
T(2*n+6,n) = A003517(n+3);
T(2*n+7,n) = A000588(n+4);
T(2*n+8,n) = A003518(n+4);
T(2*n+9,n) = A001392(n+5);
T(2*n+10,n) = A003519(n+5);
T(2*n+11,n) = A000589(n+6);
T(2*n+12,n) = A090749(n+6);
T(2*n+13,n) = A000590(n+7).

A037952 a(n) = binomial(n, floor((n-1)/2)).

Original entry on oeis.org

0, 1, 1, 3, 4, 10, 15, 35, 56, 126, 210, 462, 792, 1716, 3003, 6435, 11440, 24310, 43758, 92378, 167960, 352716, 646646, 1352078, 2496144, 5200300, 9657700, 20058300, 37442160, 77558760, 145422675, 300540195, 565722720, 1166803110, 2203961430, 4537567650
Offset: 0

Views

Author

Keywords

Comments

First differences of central binomial coefficients: a(n) = A001405(n+1) - A001405(n).
The maximum size of an intersecting (or proper) antichain on an n-set. - Vladeta Jovovic, Dec 27 2000
Number of ordered trees with n+1 edges, having root of degree at least 2 and nonroot nodes of outdegree 0 or 2. - Emeric Deutsch, Aug 02 2002
a(n)=number of Dyck (n+1)-paths that are symmetric but not prime. A prime Dyck path is one that returns to the x-axis only at its terminal point. For example a(3)=3 counts UDUUDDUD, UUDDUUDD, UDUDUDUD. - David Callan, Dec 09 2004
Number of involutions of [n+2] containing the pattern 132 exactly once. For example, a(3)=3 because we have 1'3'2'45, 42'5'13' and 52'4'3'1 (the entries corresponding to the pattern 132 are "primed"). - Emeric Deutsch, Nov 17 2005
Also number of ways to put n eggs in floor(n/2) baskets where order of the baskets matters and all baskets have at least 1 egg. - Ben Paul Thurston, Sep 30 2006
For n >= 1 the number of standard Young tableaux with shapes corresponding to partitions into at most 2 distinct parts. - Joerg Arndt, Oct 25 2012
It seems that 3, 4, 10, ... are Colbourn's Covering Array Numbers CAN(2,k,2). - Ryan Dougherty, May 27 2015
Essentially the same as A007007. - Georg Fischer, Oct 02 2018
a(n) is the number of subsets of {1,2,...,n} that contain exactly 1 more odd than even elements. For example, for n = 6, a(6) = 15 and the 15 sets are {1}, {3}, {5}, {1,2,3}, {1,2,5}, {1,3,4}, {1,3,6}, {1,4,5}, {1,5,6}, {2,3,5}, {3,4,5}, {3,5,6}, {1,2,3,4,5}, {1,2,3,5,6}, {1,3,4,5,6}. - Enrique Navarrete, Dec 21 2019
a(n) is the number of lattice paths of n steps taken from the step set {U=(1,1), D=(1,-1)} that start at the origin, never go below the x-axis, and end strictly above the x-axis; more succinctly, proper left factors of Dyck paths. For example, a(3)=3 counts UUU, UUD, UDU, and a(4)=4 counts UUUU, UUUD, UUDU, UDUU. - David Callan and Emeric Deutsch, Jan 25 2021
For n >= 3, a(n) is also the number of pinnacle sets in the (n-2)-Plummer-Toft graph. - Eric W. Weisstein, Sep 11 2024

Crossrefs

Cf. A007007, A032263, A014495 (partial sums), A001405 (partial sums + 1).
Cf. A265848.

Programs

  • Haskell
    a037952 n = a037952_list !! n
    a037952_list = zipWith (-) (tail a001405_list) a001405_list
    -- Reinhard Zumkeller, Mar 04 2012
    
  • Magma
    [Binomial(n, Floor((n-1)/2)): n in [0..40]]; // G. C. Greubel, Jun 21 2022
    
  • Maple
    a:= n-> binomial(n, floor((n-1)/2)):
    seq(a(n), n=0..35);  # Alois P. Heinz, Sep 19 2017
  • Mathematica
    Table[ Binomial[n, Floor[n/2]], {n, 0, 35}]//Differences (* Jean-François Alcover, Jun 10 2013 *)
    f[n_] := Binomial[n, Floor[(n-1)/2]]; Array[f, 35, 0] (* Robert G. Wilson v, Nov 13 2014 *)
  • PARI
    a(n) = binomial(n, (n-1)\2); \\ Altug Alkan, Oct 03 2018
    
  • SageMath
    [binomial(n, (n-1)//2) for n in (0..40)] # G. C. Greubel, Jun 21 2022

Formula

E.g.f.: BesselI(1, 2*x) + BesselI(2, 2*x). - Vladeta Jovovic, Apr 28 2003
O.g.f.: (1-sqrt(1-4x^2))/(x - 2x^2 + x*sqrt(1-4x^2)).
Convolution of A001405 and A126120 shifted right: g001405(x)*g126120(x) = g037952(x)/x. - Philippe Deléham, Mar 17 2007
D-finite with recurrence: (n+2)*a(n) + (-n-2)*a(n-1) + 2*(-2*n+1)*a(n-2) + 4*(n-2)*a(n-3) = 0. - R. J. Mathar, Jan 25 2013. Proved by Robert Israel, Nov 13 2014
For n > 0: a(n) = A265848(n,0). - Reinhard Zumkeller, Dec 24 2015
a(n) = binomial(n, (n-2)/2) = A001791(n/2), n even; a(n) = binomial(n, (n+1)/2) = A001700((n-1)/2), n odd. - Enrique Navarrete, Dec 21 2019
From R. J. Mathar, Sep 23 2021: (Start)
A001405(n) = a(n) + A000108(n/2), where A(.)=0 for non-integer arguments.
a(n) = Sum_{m=1..n} A053121(n,m) [comment Callan-Deutsch].
a(2n+1) = A000984(n+1)/2. (End)
a(n) = Sum_{k=2..n} A143359(n,k). [Callan's 2004 comment]. - R. J. Mathar, Sep 24 2021
From Amiram Eldar, Sep 27 2024: (Start)
Sum_{n>=1} 1/a(n) = 1 + Pi/sqrt(3).
Sum_{n>=1} (-1)^(n+1)/a(n) = (3 - Pi/sqrt(3))/9. (End)

A047884 Triangle of numbers a(n,k) = number of Young tableaux with n cells and k rows (1 <= k <= n); also number of self-inverse permutations on n letters in which the length of the longest scattered (i.e., not necessarily contiguous) increasing subsequence is k.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 5, 3, 1, 1, 9, 11, 4, 1, 1, 19, 31, 19, 5, 1, 1, 34, 92, 69, 29, 6, 1, 1, 69, 253, 265, 127, 41, 7, 1, 1, 125, 709, 929, 583, 209, 55, 8, 1, 1, 251, 1936, 3356, 2446, 1106, 319, 71, 9, 1, 1, 461, 5336, 11626, 10484, 5323, 1904, 461, 89, 10, 1
Offset: 1

Views

Author

Keywords

Examples

			For n=3 the 4 tableaux are
  1 2 3 . 1 2 . 1 3 . 1
  . . . . 3 . . 2 . . 2
  . . . . . . . . . . 3
Triangle begins:
  1;
  1,   1;
  1,   2,    1;
  1,   5,    3,     1;
  1,   9,   11,     4,     1;
  1,  19,   31,    19,     5,    1;
  1,  34,   92,    69,    29,    6,    1;
  1,  69,  253,   265,   127,   41,    7,   1;
  1, 125,  709,   929,   583,  209,   55,   8,  1;
  1, 251, 1936,  3356,  2446, 1106,  319,  71,  9,  1;
  1, 461, 5336, 11626, 10484, 5323, 1904, 461, 89, 10,  1;
  ...
		

References

  • W. Fulton, Young Tableaux, Cambridge, 1997.
  • D. Stanton and D. White, Constructive Combinatorics, Springer, 1986.

Crossrefs

Row sums give A000085.
Cf. A049400, A049401, and A178249 which imposes contiguity.
Columns k=1-10 give: A000012, A014495, A217323, A217324, A217325, A217326, A217327, A217328, A217321, A217322. - Alois P. Heinz, Oct 03 2012
a(2n,n) gives A267436.

Programs

  • Maple
    h:= proc(l) local n; n:=nops(l); add(i, i=l)!/mul(mul(1+l[i]-j+
           add(`if`(l[k]>=j, 1, 0), k=i+1..n), j=1..l[i]), i=1..n)
        end:
    g:= proc(n, i, l) `if`(n=0 or i=1, (p->h(p)*x^`if`(p=[], 0, p[1]))
          ([l[], 1$n]), add(g(n-i*j, i-1, [l[], i$j]), j=0..n/i))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(g(n$2, [])):
    seq(T(n), n=1..14); # Alois P. Heinz, Apr 16 2012, revised Mar 05 2014
  • Mathematica
    Table[ Plus@@( NumberOfTableaux/@ Reverse/@Union[ Sort/@(Compositions[ n-m, m ]+1) ]), {n, 12}, {m, n} ]
    (* Second program: *)
    h[l_] := With[{n=Length[l]}, Total[l]!/Product[Product[1+l[[i]]-j+Sum[If[ l[[k]] >= j, 1, 0], {k, i+1, n}], {j, 1, l[[i]]}], {i, 1, n}]];
    g[n_, i_, l_] := If[n== 0|| i==1, Function[p, h[p]*x^If[p == {}, 0, p[[1]] ] ] [ Join[l, Array[1&, n]]], Sum[g[n-i*j, i-1, Join[l, Array[i&, j]]], {j, 0, n/i}]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 1, n}]][g[n, n, {}]];
    Table[T[n], {n, 1, 14}] // Flatten (* Jean-François Alcover, Oct 26 2015, after Alois P. Heinz *)

Extensions

Definition amended ('scattered' added) by Wouter Meeussen, Dec 22 2010

A094718 Array T read by antidiagonals: T(n,k) is the number of involutions avoiding 132 and 12...k.

Original entry on oeis.org

0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 2, 2, 1, 0, 1, 2, 3, 4, 1, 0, 1, 2, 3, 5, 4, 1, 0, 1, 2, 3, 6, 8, 8, 1, 0, 1, 2, 3, 6, 9, 13, 8, 1, 0, 1, 2, 3, 6, 10, 18, 21, 16, 1, 0, 1, 2, 3, 6, 10, 19, 27, 34, 16, 1, 0, 1, 2, 3, 6, 10, 20, 33, 54, 55, 32, 1, 0, 1, 2, 3, 6, 10, 20, 34, 61, 81, 89, 32, 1
Offset: 1

Views

Author

Ralf Stephan, May 23 2004

Keywords

Comments

Also, number of paths along a corridor with width k, starting from one side (from H. Bottomley's comment in A061551).
Rows converge to binomial(n,floor(n/2)) (A001405).
Note that the rows and columns start at 1, which for example obscures the fact that the first row refers to A000007 and not to A000004. A better choice is the indexing 0 <= k and 0 <= n. The Maple program below uses this indexing and builds only on the roots of -1. - Peter Luschny, Sep 17 2020

Examples

			Array begins
  0   0   0   0   0   0   0   0   0   0 ...
  1   1   1   1   1   1   1   1   1   1 ...
  1   2   2   4   4   8   8  16  16  32 ...
  1   2   3   5   8  13  21  34  55  89 ...
  1   2   3   6   9  18  27  54  81 162 ...
  1   2   3   6  10  19  33  61 108 197 ...
  1   2   3   6  10  20  34  68 116 232 ...
  1   2   3   6  10  20  35  69 124 241 ...
  1   2   3   6  10  20  35  70 125 250 ...
  1   2   3   6  10  20  35  70 126 251 ...
  ...
		

Crossrefs

Main diagonal is A014495, antidiagonal sums are in A094719.
Cf. A080934 (permutations).

Programs

  • Maple
    X := (j, n) -> (-1)^(j/(n+1)) - (-1)^((n-j+1)/(n+1)):
    R := n -> select(k -> type(k, odd), [$(1..n)]):
    T := (n, k) -> add((2 + X(j,n))*X(j,n)^k, j in R(n))/(n+1):
    seq(lprint([n], seq(simplify(T(n, k)), k=0..10)), n=0..9); # Peter Luschny, Sep 17 2020
  • Mathematica
    U = ChebyshevU;
    m = maxExponent = 14;
    row[1] = Array[0&, m];
    row[k_] := 1/(x U[k, 1/(2x)])*Sum[U[j, 1/(2x)], {j, 0, k-1}] + O[x]^m // CoefficientList[#, x]& // Rest;
    T = Table[row[n], {n, 1, m}];
    Table[T[[n-k+1, k]], {n, 1, m-1}, {k, 1, n}] // Flatten (* Jean-François Alcover, Nov 17 2018 *)

Formula

G.f. for k-th row: 1/(x*U(k, 1/(2*x))) * Sum_{j=0..k-1} U(j, 1/(2*x)), with U(k, x) the Chebyshev polynomials of second kind. [Clarified by Jean-François Alcover, Nov 17 2018]
T(n, k) = (1/(n+1))*Sum_{j=1..n, j odd} (2 + [j, n]) * [j, n]^k where [j, n] := (-1)^(j/(n+1)) - (-1)^((n-j+1)/(n+1)). - Peter Luschny, Sep 17 2020

A370507 T(n,k) is the number permutations p of [n] that are k-dist-increasing but not j-dist-increasing for any j=0 and p(i)=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 2, 3, 0, 1, 5, 7, 11, 0, 1, 9, 22, 33, 55, 0, 1, 19, 77, 112, 192, 319, 0, 1, 34, 189, 480, 788, 1315, 2233, 0, 1, 69, 526, 2187, 3500, 5987, 10409, 17641, 0, 1, 125, 1625, 6811, 18273, 30568, 53791, 92917, 158769, 0, 1, 251, 4111, 23507, 101424, 167480, 299769, 528253, 925337, 1578667
Offset: 0

Views

Author

Alois P. Heinz, Feb 20 2024

Keywords

Examples

			T(4,1) = 1: 1234.
T(4,2) = 5: 1243, 1324, 2134, 2143, 3142.
T(4,3) = 7: 1342, 1423, 1432, 2314, 2413, 3124, 3214.
T(4,4) = 11: 2341, 2431, 3241, 3412, 3421, 4123, 4132, 4213, 4231, 4312, 4321.
Triangle T(n,k) begins:
  1;
  0, 1;
  0, 1,   1;
  0, 1,   2,    3;
  0, 1,   5,    7,   11;
  0, 1,   9,   22,   33,    55;
  0, 1,  19,   77,  112,   192,   319;
  0, 1,  34,  189,  480,   788,  1315,  2233;
  0, 1,  69,  526, 2187,  3500,  5987, 10409, 17641;
  0, 1, 125, 1625, 6811, 18273, 30568, 53791, 92917, 158769;
  ...
		

Crossrefs

Columns k=0-2 give: A000007, A057427, A014495.
Main diagonal gives A370514, also A370506(n,1) for n>=1.
Row sums give A000142.
Cf. A370505.

Programs

  • Maple
    q:= proc(l, k) local i; for i from 1 to nops(l)-k do
          if l[i]>=l[i+k] then return 0 fi od; 1
        end:
    m:= proc(l) local k;
          for k from 0 to nops(l) do if q(l, k)>0 then return k fi od
        end:
    b:= proc(n) b(n):= add(x^m(l), l=combinat[permute](n)) end:
    T:= (n, k)-> coeff(b(n), x, k):
    seq(seq(T(n, k), k=0..n), n=0..8);
  • Mathematica
    q[l_, k_] := Module[{i}, For[i = 1, i <= Length[l] - k, i++, If[l[[i]] >= l[[i + k]], Return [0]]]; 1];
    m[l_] := Module[{k}, For[k = 0, k <= Length[l], k++, If[q[l, k] > 0, Return[k]]]];
    b[n_] := Sum[x^m[l], {l, Permutations[Range@n]}];
    T[n_, k_] := Coefficient[b[n], x, k];
    Table[Table[T[n, k], {k, 0, n}], {n, 0, 8}] // Flatten (* Jean-François Alcover, Feb 29 2024, after Alois P. Heinz *)

A047161 Number of nonempty subsets of {1,2,...,n} in which exactly 1/3 of the elements are <= n/2.

Original entry on oeis.org

0, 0, 1, 2, 6, 9, 21, 30, 70, 100, 235, 335, 791, 1127, 2681, 3822, 9150, 13050, 31401, 44802, 108262, 154517, 374715, 534963, 1301235, 1858155, 4531423, 6472167, 15818791, 22597759, 55339849, 79067374, 193962894, 277164294, 680963509, 973184312, 2394289028, 3422117189
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • PARI
    a(n) = {my(m=n\2); sum(k=1, (n+1)\4, binomial(m, k)*binomial(n-m, 2*k))} \\ Andrew Howroyd, Apr 11 2021

Formula

a(n) = Sum_{k>=1} binomial(floor(n/2), k)*binomial(ceiling(n/2), 2*k). - Andrew Howroyd, Apr 11 2021

Extensions

Terms a(35) and beyond from Andrew Howroyd, Apr 11 2021

A370505 T(n,k) is the difference between the number of k-dist-increasing and (k-1)-dist-increasing permutations of [n], where p is k-dist-increasing if k>=0 and p(i)=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 2, 3, 0, 1, 5, 6, 12, 0, 1, 9, 20, 30, 60, 0, 1, 19, 70, 90, 180, 360, 0, 1, 34, 175, 420, 630, 1260, 2520, 0, 1, 69, 490, 1960, 2520, 5040, 10080, 20160, 0, 1, 125, 1554, 5880, 15120, 22680, 45360, 90720, 181440, 0, 1, 251, 3948, 21000, 88200, 113400, 226800, 453600, 907200, 1814400
Offset: 0

Views

Author

Alois P. Heinz, Feb 20 2024

Keywords

Examples

			T(0,0) = 1: (only) the empty permutation is 0-dist-increasing.
T(4,2) = 5 = 6 - 1 = |{1234, 1243, 1324, 2134, 2143, 3142}| - |{1234}|.
Permutation 3142 is 2-dist-increasing and 4-dist-increasing but not 3-dist-increasing.
Triangle T(n,k) begins:
  1;
  0, 1;
  0, 1,   1;
  0, 1,   2,    3;
  0, 1,   5,    6,   12;
  0, 1,   9,   20,   30,    60;
  0, 1,  19,   70,   90,   180,   360;
  0, 1,  34,  175,  420,   630,  1260,  2520;
  0, 1,  69,  490, 1960,  2520,  5040, 10080, 20160;
  0, 1, 125, 1554, 5880, 15120, 22680, 45360, 90720, 181440;
  ...
		

Crossrefs

Columns k=0-2 give: A000007, A057427, A014495.
Row sums give A000142.
Main diagonal gives A001710.
T(2n,n+1) gives A000680 for n>=1.
T(2n,n) gives A370576.

Programs

  • Maple
    b:= proc(n, k) option remember; `if`(k<1,
         `if`(n=k, 1, 0), n!/mul(iquo(n+i, k)!, i=0..k-1))
        end:
    T:= (n, k)-> b(n, k)-b(n, k-1):
    seq(seq(T(n, k), k=0..n), n=0..10);

Formula

T(n,k) = A248686(n,k) - A248686(n,k-1) for k>=2.
Sum_{k=0..n} (1+n-k) * T(n,k) = A248687(n) for n>=1.
Showing 1-10 of 14 results. Next