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.

Previous Showing 41-50 of 72 results. Next

A034869 Right half of Pascal's triangle.

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 6, 4, 1, 10, 5, 1, 20, 15, 6, 1, 35, 21, 7, 1, 70, 56, 28, 8, 1, 126, 84, 36, 9, 1, 252, 210, 120, 45, 10, 1, 462, 330, 165, 55, 11, 1, 924, 792, 495, 220, 66, 12, 1, 1716, 1287, 715, 286, 78, 13, 1, 3432, 3003, 2002, 1001, 364, 91, 14, 1
Offset: 0

Views

Author

Keywords

Comments

From R. J. Mathar, May 13 2006: (Start)
Also flattened table of the expansion coefficients of x^n in Chebyshev Polynomials T_k(x) of the first kind:
x^n is 2^(1-n) multiplied by the sum of floor(1+n/2) terms using only terms T_k(x) with even k if n even, only terms T_k(x) with odd k if n is odd and halving the coefficient a(..) in front of any T_0(x):
x^0=2^(1-0) a(0)/2 T_0(x)
x^1=2^(1-1) a(1) T_1(x)
x^2=2^(1-2) [a(2)/2 T_0(x)+a(3) T_2(x)]
x^3=2^(1-3) [a(4) T_1(x)+a(5) T_3(x)]
x^4=2^(1-4) [a(6)/2 T_0(x)+a(7) T_2(x) +a(8) T_4(x)]
x^5=2^(1-5) [a(9) T_1(x)+a(10) T_3(x) +a(11) T_5(x)]
x^6=2^(1-6) [a(12)/2 T_0(x)+a(13) T_2(x) +a(14) T_4(x) +a(15) T_6(x)]
x^7=2^(1-7) [a(16) T_1(x)+a(17) T_3(x) +a(18) T_5(x) +a(19) T_7(x)]" (End)
T(n,k) = A034868(n,floor(n/2)-k), k = 0..floor(n/2). - Reinhard Zumkeller, Jul 27 2012
Rows are binomial(r-1,(2r+1-(-1)^r)\4 -n ) where r is the row and n is the term. Columns are binomial(2m+c-3,m-1) where c is the column and m is the term. - Anthony Browne, May 17 2016

Examples

			The table starts:
  1
  1
  2 1
  3 1
  6 4 1
  ...
		

Crossrefs

Cf. A007318, A008619 (row lengths).
Cf. A110654.
Cf. A034868 (left half), A014413, A014462, A027306 (row sums).
Columns k=0-1-2-3-4 give: A001405, A037955, A037956, A037957, A037958.

Programs

  • Haskell
    a034869 n k = a034869_tabf !! n !! k
    a034869_row n = a034869_tabf !! n
    a034869_tabf = [1] : f 0 [1] where
       f 0 us'@(_:us) = ys : f 1 ys where
                        ys = zipWith (+) us' (us ++ [0])
       f 1 vs@(v:_) = ys : f 0 ys where
                      ys = zipWith (+) (vs ++ [0]) ([v] ++ vs)
    -- Reinhard Zumkeller, improved Dec 21 2015, Jul 27 2012
    
  • Maple
    for n from 0 to 60 do for j from n mod 2 to n by 2 do print( binomial(n,(n-j)/2) ); od; od; # R. J. Mathar, May 13 2006
    # Second program:
    egf:= k-> BesselI(2*k, 2*x) + BesselI(2*k+1, 2*x):
    A034869:= (n, k)-> n! * coeff(series(egf(k), x, n+1), x, n):
    seq(print(seq(A034869(n, k), k=0..iquo(n, 2))), n=0..14); # Mélika Tebni, Sep 05 2024
  • Mathematica
    Table[Binomial[n, k], {n, 0, 14}, {k, Ceiling[n/2], n}] // Flatten (* Michael De Vlieger, May 19 2016 *)
  • PARI
    for(n=0, 14, for(k=ceil(n/2), n, print1(binomial(n, k),", ");); print();) \\ Indranil Ghosh, Mar 31 2017
    
  • Python
    import math
    from sympy import binomial
    for n in range(15):
        print([binomial(n, k) for k in range(math.ceil(n/2), n + 1)]) # Indranil Ghosh, Mar 31 2017

Formula

E.g.f. of column k: BesselI(2*k,2*x) + BesselI(2*k+1,2*x). - Mélika Tebni, Sep 05 2024

Extensions

Keyword fixed and example added by Franklin T. Adams-Watters, May 27 2010

A045723 Number of configurations, excluding reflections and black-white interchanges, of n black and n white beads on a string.

Original entry on oeis.org

1, 1, 3, 7, 23, 71, 252, 890, 3299, 12283, 46508, 176870, 677294, 2602198, 10034104, 38787572, 150289699, 583434323, 2268861516, 8836447022, 34461940538, 134564992898, 526025965864, 2058359779052, 8061905791118, 31602659998046
Offset: 0

Views

Author

Keywords

Comments

This sequence (with offset 0) equals the probable number of inequivalent classes of permutations acting on an n-party state under the trace norm in the context of permutation criteria for separability. - Lieven Clarisse, Apr 28 2006
Number of connected components of an undirected graph where the nodes are the n-subsets of {1,...,2n} and an edge (A,B) appears if B = {1,...,2n} \ A or B = {2n + 1 - i: i in A}. See Mathematics Magazine link. - Rob Pratt, Aug 10 2015
Number of distinct staircase walks connecting opposite corners of a square grid of side n > 1. - Christian Barrientos, Nov 25 2018

Crossrefs

Programs

  • Mathematica
    Table[ 1/4 (2^n + Binomial[ 2 n, n ] + 2 Binomial[ -1 + n, 1/2 (-2 + n) ]*Mod[ 1 + n, 2 ]), {n, 0, 24} ]
  • PARI
    a(n) = (1/4)*(2^n + binomial(2*n, n) + if ((n+1)%2, 2*binomial(n-1, (1/2)*(n-2)))); \\ Michel Marcus, Nov 25 2018

Formula

a(n) = (1/4)*(2^n + C(2*n, n) + 2*C(n-1, (1/2)*(n-2))*((n+1) mod 2)).
a(n) = A042971(n) + A027306(n). - Michel Marcus, Nov 26 2018

A092429 a(n) = n! * Sum_{i,j,k,l >= 0, i+j+k+l = n} 1/(i!*j!*k!*l!).

Original entry on oeis.org

1, 1, 3, 10, 47, 126, 522, 1821, 8143, 26326, 109958, 396111, 1737122, 5998955, 24949277, 91979985, 397402223, 1418993350, 5881338702, 22010456331, 94022106862, 342803313261, 1416758002487, 5356198979731, 22685035586290, 83911052895151, 345921828889367
Offset: 0

Views

Author

Benoit Cloitre, Mar 22 2004

Keywords

Comments

a(n) is even iff n is a sum of 2 distinct powers of 2.

Crossrefs

Column k=4 of A226873. - Alois P. Heinz, Jun 21 2013

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(t=1, 1/n!, add(b(n-j, j, t-1)/j!, j=i..n/t))
        end:
    a:= n-> n!*b(n, 0, 4):
    seq(a(n), n=0..30);  # Alois P. Heinz, Sep 21 2017
  • Mathematica
    Table[Sum[Sum[Sum[Sum[If[i+j+k+l==n,n!/i!/j!/k!/l!,0],{l,0,k}],{k,0,j}],{j,0,i}],{i,0,n}],{n,0,20}] (* Vaclav Kotesovec, Jul 01 2013 *)
    CoefficientList[Series[(HypergeometricPFQ[{},{},x]^4 +6*HypergeometricPFQ[{},{},x]^2 *HypergeometricPFQ[{},{1},x^2] +8*HypergeometricPFQ[{},{},x] *HypergeometricPFQ[{},{1,1},x^3] +3*HypergeometricPFQ[{},{1},x^2]^2 +6*HypergeometricPFQ[{},{1,1,1},x^4])/24, {x, 0, 20}], x]* Range[0, 20]! (* Vaclav Kotesovec after Vladeta Jovovic, Jul 01 2013 *)
  • PARI
    a(n)=sum(i=0,n,sum(j=0,i,sum(k=0,j,sum(l=0,k,if(i+j+k+l-n,0,n!/i!/j!/k!/l!)))))

Formula

E.g.f.: (t(1)^4 + 6*t(1)^2*t(2) + 8*t(1)*t(3) + 3*t(2)^2 + 6*t(4))/24 where t(1) = hypergeom([],[],x), t(2) = hypergeom([],[1],x^2), t(3) = hypergeom([],[1,1],x^3) and t(4) = hypergeom([],[1,1,1],x^4). - Vladeta Jovovic, Sep 22 2007, typo corrected by Vaclav Kotesovec, Jul 01 2013
Conjecture: a(n) ~ 4^n/4!. - Vaclav Kotesovec, Mar 07 2014

A100067 a(n) = Sum_{k=0..floor(n/2)} binomial(n,k)*2^(n-2*k).

Original entry on oeis.org

1, 2, 6, 14, 38, 92, 240, 590, 1510, 3740, 9476, 23564, 59372, 147968, 371636, 927374, 2324870, 5805740, 14538660, 36322340, 90898228, 227153192, 568235696, 1420236524, 3551943388, 8878506392, 22201466280, 55498465400, 138766221800, 346895496200, 867316299260, 2168213189390
Offset: 0

Views

Author

Paul Barry, Nov 02 2004

Keywords

Comments

An inverse Chebyshev transform of x/(1-2*x), where the Chebyshev transform of g(x) is ((1-x^2)/(1+x^2))*g(x/(1+x^2)) and the inverse transform maps a g.f. A(x) to (1/sqrt(1-4*x^2))*A(x*c(x^2)) where c(x) is the g.f. of the Catalan numbers A000108. In general, Sum_{k=0..floor(n/2)} binomial(n,k) * r^(n-2*k) has g.f. 2*x/(sqrt(1-4*x^2)*(r*sqrt(1-4*x^2) + 2*x - r)). - corrected by Vaclav Kotesovec, Dec 06 2012
Generally (for r>1), a(n) ~ (r + 1/r)^n. - Vaclav Kotesovec, Dec 06 2012
Hankel transform is A088138(n+1). - Paul Barry, Jun 16 2009

Crossrefs

Programs

  • Magma
    m:=2; [(&+[Binomial(n,k)*m^(n-2*k): k in [0..Floor(n/2)]]): n in [0..40]]; // G. C. Greubel, Jun 08 2022
    
  • Mathematica
    CoefficientList[Series[x/(Sqrt[1-4*x^2]*(Sqrt[1-4*x^2]+x-1)), {x, 0, 20}], x] (* Vaclav Kotesovec, Dec 06 2012 *)
  • PARI
    my(x='x+O('x^66)); Vec(x/(sqrt(1-4*x^2)*(sqrt(1-4*x^2)+x-1))) \\ Joerg Arndt, May 12 2013
    
  • SageMath
    m=2; [sum(binomial(n,k)*m^(n-2*k) for k in (0..n//2)) for n in (0..40)] # G. C. Greubel, Jun 08 2022

Formula

G.f.: x/(sqrt(1-4*x^2)*(sqrt(1-4*x^2)+x-1)).
a(n) = Sum_{k=0..floor(n/2)} binomial(n, k)*2^(n-2*k).
a(n) = Sum_{k=0..n} binomial(n, (n-k)/2)*(1 + (-1)^(n-k))*2^k/2.
Recurrence: 2*n*(3*n-7)*a(n) = (15*n^2 - 35*n + 8)*a(n-1) + 4*(6*n^2 - 20*n + 11)*a(n-2) - 20*(n-2)*(3*n-4)*a(n-3). - Vaclav Kotesovec, Dec 06 2012
a(n) ~ 5^n/2^n. - Vaclav Kotesovec, Dec 06 2012

A345907 Triangle giving the main antidiagonals of the matrices counting integer compositions by length and alternating sum (A345197).

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 2, 2, 1, 1, 0, 0, 4, 3, 1, 1, 0, 0, 3, 6, 4, 1, 1, 0, 0, 6, 9, 8, 5, 1, 1, 0, 0, 0, 18, 18, 10, 6, 1, 1, 0, 0, 0, 10, 36, 30, 12, 7, 1, 1, 0, 0, 0, 20, 40, 60, 45, 14, 8, 1, 1, 0, 0, 0, 0, 80, 100, 90, 63, 16, 9, 1, 1
Offset: 0

Views

Author

Gus Wiseman, Jul 26 2021

Keywords

Comments

The matrices (A345197) count the integer compositions of n of length k with alternating sum i, where 1 <= k <= n, and i ranges from -n + 2 to n in steps of 2. Here, the alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.
Problem: What are the column sums? They appear to match A239201, but it is not clear why.

Examples

			Triangle begins:
   1
   1   1
   0   1   1
   0   1   1   1
   0   2   2   1   1
   0   0   4   3   1   1
   0   0   3   6   4   1   1
   0   0   6   9   8   5   1   1
   0   0   0  18  18  10   6   1   1
   0   0   0  10  36  30  12   7   1   1
   0   0   0  20  40  60  45  14   8   1   1
   0   0   0   0  80 100  90  63  16   9   1   1
   0   0   0   0  35 200 200 126  84  18  10   1   1
   0   0   0   0  70 175 400 350 168 108  20  11   1   1
   0   0   0   0   0 350 525 700 560 216 135  22  12   1   1
		

Crossrefs

Row sums are A163493.
Rows are the antidiagonals of the matrices given by A345197.
The main diagonals of A345197 are A346632, with sums A345908.
A011782 counts compositions.
A097805 counts compositions by alternating (or reverse-alternating) sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A316524 gives the alternating sum of prime indices (reverse: A344616).
Other diagonals are A008277 of A318393 and A055884 of A320808.
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 A058622(n-1), ranked by A345915/A345916.
- k > 0: counted by A027306, ranked by A345917/A345918.
- k < 0: counted by A294175, ranked by A345919/A345920.
- k != 0: counted by A058622, ranked by A345921/A345921.
- k even: counted by A081294, ranked by A053754/A053754.
- k odd: counted by A000302, ranked by A053738/A053738.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{n-k}],k==(n+ats[#])/2-1&]],{k,0,n-1}],{n,0,15}]

A349155 Numbers k such that the k-th composition in standard order has sum equal to negative twice its reverse-alternating sum.

Original entry on oeis.org

0, 9, 130, 135, 141, 153, 177, 193, 225, 2052, 2059, 2062, 2069, 2074, 2079, 2089, 2098, 2103, 2109, 2129, 2146, 2151, 2157, 2169, 2209, 2242, 2247, 2253, 2265, 2289, 2369, 2434, 2439, 2445, 2457, 2481, 2529, 2561, 2689, 2818, 2823, 2829, 2841, 2865, 2913
Offset: 1

Views

Author

Gus Wiseman, Nov 22 2021

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
The reverse-alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(k-i) y_i.

Examples

			The terms and corresponding compositions begin:
     0: ()
     9: (3,1)
   130: (6,2)
   135: (5,1,1,1)
   141: (4,1,2,1)
   153: (3,1,3,1)
   177: (2,1,4,1)
   193: (1,6,1)
   225: (1,1,5,1)
  2052: (9,3)
  2059: (8,2,1,1)
  2062: (8,1,1,2)
  2069: (7,2,2,1)
  2074: (7,1,2,2)
  2079: (7,1,1,1,1,1)
  2089: (6,2,3,1)
  2098: (6,1,3,2)
  2103: (6,1,2,1,1,1)
		

Crossrefs

These compositions are counted by A224274 up to 0's.
An unordered version is A348617, counted by A001523 up to 0's.
The positive version is A349153, unreversed A348614.
The unreversed version is A349154.
Positive unordered unreversed: A349159, counted by A000712 up to 0's.
A positive unordered version is A349160, counted by A006330 up to 0's.
A003242 counts Carlitz compositions.
A011782 counts compositions.
A025047 counts alternating or wiggly compositions, complement A345192.
A034871, A097805, and A345197 count compositions by alternating sum.
A103919 counts partitions by alternating sum, reverse A344612.
A116406 counts compositions with alternating sum >=0, ranked by A345913.
A138364 counts compositions with alternating sum 0, ranked by A344619.
Statistics of standard compositions:
- The compositions themselves are the rows of A066099.
- Number of parts is given by A000120, distinct A334028.
- Sum and product of parts are given by A070939 and A124758.
- Maximum and minimum parts are given by A333766 and A333768.
- Heinz number is given by A333219.
Classes of standard compositions:
- Partitions and strict partitions are ranked by A114994 and A333256.
- Multisets and sets are ranked by A225620 and A333255.
- Strict and constant compositions are ranked by A233564 and A272919.
- Carlitz compositions are ranked by A333489, complement A348612.
- Alternating compositions are ranked by A345167, complement A345168.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[ Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    sats[y_]:=Sum[(-1)^(i-Length[y])*y[[i]],{i,Length[y]}];
    Select[Range[0,1000],Total[stc[#]]==-2*sats[stc[#]]&]

A110166 Row sums of Riordan array A110165.

Original entry on oeis.org

1, 4, 18, 85, 410, 1999, 9807, 48304, 238570, 1180615, 5851253, 29033074, 144190943, 716652070, 3564079250, 17734184365, 88280673770, 439625873215, 2189988826125, 10912480440850, 54389237971285, 271142650382080
Offset: 0

Views

Author

Paul Barry, Jul 14 2005

Keywords

Comments

Number of 5-ary words of length n in which the number of 1's does not exceed the number of 0's. - David Scambler, Aug 14 2012
From Peter Bala, Jan 09 2022: (Start)
Conjectures: for k >= 2, the number of k-ary words of length n such that the number of 1's <= the number of 0's is equal to the coefficient of x^n in the expansion of ( k*x + 1/(1 + x) )^n, and satisfies the recurrence u(0) = 1, u(1) = k-1 and n*u(n) = (k-2)*(2*n-1)*u(n-1) - k*(k-4)*(n-1)* u(n-2) + k^(n-1) for n >= 2.
For cases see A027306 (k = 2), A027914 (k = 3) and A032443 (k = 4). (End)

Crossrefs

Programs

  • Maple
    seq( (1/2)*(5^n + add(binomial(n,k)*binomial(2*k,k), k = 0..n)), n = 0..30); # Peter Bala, Jan 08 2022
  • Mathematica
    Table[Sum[Sum[Binomial[n,j]Binomial[2j,j+k],{j,0,n}],{k,0,n}],{n,0,25}] (* Harvey P. Dale, Dec 16 2011 *)

Formula

G.f.: (1/sqrt(1-6*x+5*x^2))/(1-(1-3*x-sqrt(1-6*x+5*x^2))/(2*x)).
a(n) = Sum_{k = 0..n} Sum_{j = 0..n} C(n, j)*C(2*j, j+k).
Recurrence: n*a(n) = (11*n-8)*a(n-1) - 5*(7*n-10)*a(n-2) + 25*(n-2)*a(n-3). - Vaclav Kotesovec, Oct 18 2012
a(n) ~ 5^n/2*(1+sqrt(5)/(2*sqrt(Pi*n))). - Vaclav Kotesovec, Oct 18 2012
From Peter Bala, Jan 08 2022: (Start)
a(n) = (1/2)*(5^n + A026375(n)) = (1/2)*(5^n + Sum_{k = 0..n} binomial(n,k) *binomial(2*k,k)).
a(n) = (1/2)*(5^n)*(1 + Sum_{k = 0..n} binomial(n,k)*binomial(2*k,k)*(-1/5)^k).
a(n) = [x^n] ( 5*x + 1/(1 + x) )^n.
a(0) = 1, a(1) = 4 and n*a(n) = 3*(2*n-1)*a(n-1) - 5*(n-1)*a(n-2) + 5^(n-1) for n >= 2.
The Gauss congruences a(n*p^k) == a(n*p^(k-1)) (mod p^k) hold for prime p and positive integers n and k.
Binomial transform of A032443. (End)

A226875 Number of n-length words w over a 5-ary alphabet {a1,a2,...,a5} such that #(w,a1) >= #(w,a2) >= ... >= #(w,a5) >= 0, where #(w,x) counts the letters x in word w.

Original entry on oeis.org

1, 1, 3, 10, 47, 246, 882, 3921, 18223, 84790, 432518, 1863951, 8892842, 42656147, 204204353, 1025014815, 4728033983, 22948258742, 111605089014, 541696830843, 2708218059022, 12861557284425, 62938669549583, 308273057334413, 1508708926286914, 7533652902408071
Offset: 0

Views

Author

Alois P. Heinz, Jun 21 2013

Keywords

Crossrefs

Column k=5 of A226873.

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(t=1, 1/n!, add(b(n-j, j, t-1)/j!, j=i..n/t))
        end:
    a:= n-> n!*b(n, 0, 5):
    seq(a(n), n=0..30);
  • Mathematica
    Table[Sum[Sum[Sum[Sum[Sum[If[i+j+k+l+m==n,n!/i!/j!/k!/l!/m!,0],{m,0,l}],{l,0,k}],{k,0,j}],{j,0,i}],{i,0,n}],{n,0,20}] (* Vaclav Kotesovec, Jul 01 2013 *)
    CoefficientList[Series[(HypergeometricPFQ[{},{},x]^5 + 10*HypergeometricPFQ[{},{},x]^3*HypergeometricPFQ[{},{1},x^2] + 20*HypergeometricPFQ[{},{},x]^2*HypergeometricPFQ[{},{1,1},x^3] + 20*HypergeometricPFQ[{},{1},x^2]*HypergeometricPFQ[{},{1,1},x^3] + 15*HypergeometricPFQ[{},{1},x^2]^2*HypergeometricPFQ[{},{},x] + 30*HypergeometricPFQ[{},{1,1,1},x^4]*HypergeometricPFQ[{},{},x] + 24*HypergeometricPFQ[{},{1,1,1,1},x^5])/5!,{x,0,20}],x]*Range[0,20]! (* more efficient, Vaclav Kotesovec, Jul 01 2013 *)

Formula

Conjecture: a(n) ~ 5^n/5!. - Vaclav Kotesovec, Mar 07 2014

A226881 Number of n-length binary words w with #(w,0) >= #(w,1) >= 1, where #(w,x) gives the number of digits x in w.

Original entry on oeis.org

0, 0, 2, 3, 10, 15, 41, 63, 162, 255, 637, 1023, 2509, 4095, 9907, 16383, 39202, 65535, 155381, 262143, 616665, 1048575, 2449867, 4194303, 9740685, 16777215, 38754731, 67108863, 154276027, 268435455, 614429671, 1073741823, 2448023842, 4294967295, 9756737701
Offset: 0

Views

Author

Alois P. Heinz, Jun 21 2013

Keywords

Comments

a(n) is the number of nonempty subsets of {1,2,...,n} that contain either more even than odd numbers or the same number of even and odd numbers. For example, for n=5, a(5)=15 and the 15 subsets are {2}, {4}, {1,2}, {1,4}, {2,3}, {2,4}, {2,5}, {3,4}, {4,5}, {1,2,4}, {2,3,4}, {2,4,5}, {1,2,3,4}, {1,2,4,5}, {2,3,4,5}. - Enrique Navarrete, Dec 15 2019

Examples

			a(4) = 10: 0001, 0010, 0011, 0100, 0101, 0110, 1000, 1001, 1010, 1100.
		

Crossrefs

Column k=2 of A226874.
Cf. A027306.

Programs

  • Maple
    a:= proc(n) option remember;
          `if`(n<4, n*(n-1)*(4-n)/2, (9*(n-1)*(n-4) *a(n-1)
          +(12-32*n+6*n^2) *a(n-2) -36*(n-2)*(n-4) *a(n-3)
          +8*(n-3)*(3*n-10) *a(n-4))/ (n*(3*n-13)))
        end:
    seq(a(n), n=0..40);
  • Mathematica
    Table[Sum[Binomial[n, i], {i, Floor[n/2]}], {n, 0, 30}] (* Wesley Ivan Hurt, Mar 14 2015 *)
  • PARI
    a(n) = sum(i=1, n\2, binomial(n,i)); \\ Michel Marcus, Jul 15 2022

Formula

G.f.: (3*x-1)/(2*(x-1)*(2*x-1)) + 1/(2*sqrt((1+2*x)*(1-2*x))).
a(n) = Sum_{i=1..floor(n/2)} binomial(n,i). - Wesley Ivan Hurt, Mar 14 2015
a(n) = A027306(n)-1 = 2^(n-1)-1+((1+(-1)^n)/4)*binomial(n,n/2). - Alois P. Heinz, Dec 15 2019

A322428 Sum T(n,k) of k-th largest parts of all compositions of n; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 3, 1, 8, 3, 1, 19, 8, 4, 1, 43, 20, 11, 5, 1, 94, 48, 27, 16, 6, 1, 202, 110, 64, 42, 22, 7, 1, 428, 245, 149, 100, 64, 29, 8, 1, 899, 533, 341, 228, 163, 93, 37, 9, 1, 1875, 1142, 765, 512, 383, 256, 130, 46, 10, 1, 3890, 2420, 1683, 1144, 859, 638, 386, 176, 56, 11, 1
Offset: 1

Views

Author

Alois P. Heinz, Dec 07 2018

Keywords

Examples

			The 4 compositions of 3 are: 111, 12, 21, 3.  The sums of k-th largest parts for k=1..3 give: 1+2+2+3 = 8, 1+1+1+0 = 3, 1+0+0+0 = 1.
Triangle T(n,k) begins:
     1;
     3,    1;
     8,    3,   1;
    19,    8,   4,   1;
    43,   20,  11,   5,   1;
    94,   48,  27,  16,   6,   1;
   202,  110,  64,  42,  22,   7,   1;
   428,  245, 149, 100,  64,  29,   8,  1;
   899,  533, 341, 228, 163,  93,  37,  9,  1;
  1875, 1142, 765, 512, 383, 256, 130, 46, 10, 1;
  ...
		

Crossrefs

Column k=1 gives A102712.
Row sums give A001787.
T(n+1,1+ceiling(n/2)) gives A027306.
Cf. A322427.

Programs

  • Maple
    b:= proc(n, l) option remember; `if`(n=0, add(l[-i]*x^i,
          i=1..nops(l)), add(b(n-j, sort([l[], j])), j=1..n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(b(n, [])):
    seq(T(n), n=1..12);
  • Mathematica
    b[n_, l_] := b[n, l] = If[n == 0, Sum[l[[-i]] x^i, {i, 1, Length[l]}], Sum[b[n - j, Sort[Append[l, j]]], {j, 1, n}]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 1, Exponent[p, x]}]][ b[n, {}]];
    Array[T, 12] // Flatten (* Jean-François Alcover, Dec 29 2018, after Alois P. Heinz *)
Previous Showing 41-50 of 72 results. Next