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.

User: Thomas Wieder

Thomas Wieder's wiki page.

Thomas Wieder has authored 87 sequences. Here are the ten most recent ones:

A234574 T(n,k) is the number of size k ordered submultisets of the regular multiset {1_1,1_2,...,1_(n-1),1_n, ... ,i_1,i_2,...,i_(n-1),i_n, ... ,n_1,n_2,...,n_(n-1),n_n} (which contains n copies of i for 1 <= i <= n).

Original entry on oeis.org

1, 1, 1, 1, 2, 4, 6, 6, 1, 3, 9, 27, 78, 210, 510, 1050, 1680, 1680, 1, 4, 16, 64, 256, 1020, 4020, 15540, 58380, 210840, 722400, 2310000, 6745200, 17417400, 37837800, 63063000, 63063000, 1, 5, 25, 125, 625, 3125, 15620, 77980, 388220, 1923180, 9454620
Offset: 0

Author

Thomas Wieder, Dec 29 2013

Keywords

Comments

A181567 gives the case for unordered submultisets.

Examples

			For n=2 we have the regular multiset L = [1,1,2,2].
We get the following ordered submultisets from L:
For k=0 1 multiset: []
For k=1 2 multisets: [1], [2]
For k=2 4 multisets: [1,1], [1,2], [2,1], [2,2]
For k=3 6 multisets: [1,1,2], [1,2,1], [2,1,1], [1,2,2], [2,1,2], [2,2,1]
For k=4 6 multisets: [1,1,2,2], [1,2,1,2], [1,2,2,1], [2,1,1,2], [2,1,2,1], [2,2,1,1].
Triangle begins with:
  1;
  1, 1;
  1, 2, 4, 6, 6;
  1, 3, 9, 27, 78, 210, 510, 1050, 1680, 1680;
  1, 4, 16, 64, 256, 1020, 4020, 15540, 58380, 210840, 722400, 2310000, 6745200, 17417400, 37837800, 63063000, 63063000;
  ...
		

Crossrefs

Cf. A181567.
Row sums give A274762.

Programs

  • Maple
    # first Maple program: see link above
    # second Maple program:
    b:= proc(n, k, i) option remember; `if`(k=0, 1,
         `if`(i<1, 0, add(b(n, k-j, i-1)/j!, j=0..n)))
        end:
    T:= (n, k)-> b(n, k, n)*k!:
    seq(seq(T(n, k), k=0..n^2), n=0..5); # Alois P. Heinz, Jul 04 2016

Extensions

More terms from Alois P. Heinz, Jul 04 2016

A213048 Number of preferential arrangements of n labeled elements with repetitions allowed.

Original entry on oeis.org

1, 1, 5, 31, 229, 1981, 19775, 224589, 2864901, 40591255, 632760105, 10765616885, 198543617119, 3945765358653, 84070841065937, 1911864488674531, 46222718892288645, 1183919151676806177, 32025836905529003471, 912372909851608715945, 27304698509111141688969
Offset: 0

Author

Thomas Wieder, Jun 03 2012

Keywords

Examples

			For n=2 the a(2) = 5 solutions are (1,2), (1|2), (2|1), (1|1), (2|2).
		

Crossrefs

Cf. A000670.

Programs

  • Maple
    a:= proc(n) option remember;
          `if`(n=0, 1, add(binomial(n+k-1, k)*a(n-k), k=1..n))
        end:
    seq(a(n), n=0..25);
  • Mathematica
    a[n_] := a[n] = If[n==0, 1, Sum[Binomial[n+k-1, k] a[n-k], {k, 1, n}]];
    a /@ Range[0, 25] (* Jean-François Alcover, Nov 21 2020 *)

Formula

a(n) = Sum_{k=1..n} C(n+k-1,k)*a(n-k) for n>0, a(0) = 1.
a(n) = Sum_c(n) C(n+k1-1,k1) C(n-k1+k2-1,k2) C(n-k1-k2+k3-1,k3) ..., where Sum_c(n) denotes the sum over all compositions (ordered partitions) of n = k1 + k2 + ... .
a(n) ~ c * n! * n^(log(2)) / (log(2))^n, where c = 0.9387523255426859866752735339706007723805611... . - Vaclav Kotesovec, May 03 2015

A209633 Number of ordered set partitions of the multiset [a,a,1,1,...,1] with two "a" and n "1".

Original entry on oeis.org

1, 2, 7, 15, 33, 59, 111, 182, 307, 481, 757, 1134, 1713, 2483, 3611, 5117, 7238, 10029, 13888, 18900, 25682, 34442, 46057, 60934, 80428, 105159, 137137, 177495, 229069, 293694, 375582, 477499, 605526, 764060, 961603, 1204898, 1506142, 1875150, 2329185, 2882939
Offset: 0

Author

Thomas Wieder, Mar 11 2012

Keywords

Comments

For [a,1,1,...1] one gets A093694, number of one-element transitions from the partitions of n to the partitions of n+1 for labeled parts.

Examples

			For n=4 we have the multiset [a,a,1,1,1,1] with the following a(4) = 33 ordered set partitions:
For [4] one gets [[1,1,1,1]], [[1,1,1,a]], [[1,1,a,a]].
For [3,1] one gets [[1,1,1],[1]], [[1,1,1],[a]], [[1,1,a],[1]], [[1,1,a],[a]], [[1,a,a],[1]].
For [2,2] one gets [[1,1],[1,1]], [[1,1],[1,a]], [[1,1],[a,a]], [[1,a],[1,1]], [[1,a],[1,a]], [[a,a],[1,1]].
For [2,1,1] one gets [[1,1],[1],[1]], [[1,1],[1],[a]], [[1,1],[a],[1]], [[1,1],[a],[a]], [[1,a],[1],[1]], [[1,a],[1],[a]], [[1,a],[a],[1]], [[a,a],[1],[1]].
For [1,1,1,1] one gets [[1],[1],[1],[1]], [[1],[1],[1],[a]], [[1],[1],[a],[1]], [[1],[1],[a],[a]], [[1],[a],[1],[1]], [[1],[a],[1],[a]], [[1],[a],[a],[1]], [[a],[1],[1],[1]], [[a],[1],[1],[a]], [[a],[1],[a],[1]], [[a],[a],[1],[1]].
		

Crossrefs

Cf. A093694.

Programs

  • Maple
    p:= (f, g)-> zip((x, y)-> x+y, f, g, 0):
    b:= proc(n,i) option remember; local f, g;
          if n=0 then [1, 0, [1]]
        elif i<1 then [0, 0, [0]]
        else f:= b(n, i-1); g:= `if`(i>n, [0, 0, [0]], b(n-i, i));
             [f[1]+g[1], f[2]+g[2] +`if`(i>1, g[1], 0), p(f[3], [0, g[3][]])]
          fi
        end:
    a:= proc(n) local l, ll;
          if n=0 then return 1 fi;
          l:= b(n, n); ll:= l[3];
          l[2] +add(ll[t+1] *(1+t* (1+(t-1)/2)), t=1..nops(ll)-1)
        end:
    seq(a(n), n=0..50);  # Alois P. Heinz, Mar 11 2012
  • Mathematica
    zip = With[{m = Max[Length[#1], Length[#2]]}, PadRight[#1, m] + PadRight[#2, m]]&; b[n_, i_] := b[n, i] = Module[{f, g}, Which[n == 0, {1, 0, {1}}, i<1, {0, 0, {0}}, True, f = b[n, i-1]; g = If[i>n, {0, 0, {0}}, b[n-i, i]]; {f[[1]] + g[[1]], f[[2]] + g[[2]] + If[i>1, g[[1]], 0], zip[f[[3]], Join[{0}, g[[3]]]]}]]; a[n_] := Module[{l, ll}, If[n == 0, Return[1]]; l = b[n, n]; ll = l[[3]]; l[[2]] + Sum[ll[[t+1]]*(1+t*(1+(t-1)/2)), {t, 1, Length[ll]-1}]]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Feb 13 2017, after Alois P. Heinz *)

Extensions

More terms from Alois P. Heinz, Mar 11 2012

A188667 Ordered (2,2)-selections from the multiset {1,1,2,2,3,3,...,n,n}.

Original entry on oeis.org

0, 0, 3, 21, 72, 180, 375, 693, 1176, 1872, 2835, 4125, 5808, 7956, 10647, 13965, 18000, 22848, 28611, 35397, 43320, 52500, 63063, 75141, 88872, 104400, 121875, 141453, 163296, 187572, 214455, 244125, 276768, 312576, 351747, 394485, 441000
Offset: 0

Author

Thomas Wieder, Apr 07 2011

Keywords

Comments

Number of ordered (2,2)-selections which can be taken from the first 2n elements of A008619, the positive integers repeated. Order does count among subselections, e.g. [[1,1],[2,2]] and [[2,2],[1,1]] are different (2,2)-selections. Order does not count within a subselection, e.g. [1,3] is equivalent to [3,1].
Many thanks to Alois P. Heinz, Joerg Arndt, and Olivier Gérard for pointing out bugs in earlier versions of this sequence and for their comments!
The number of (not ordered) (2,2)-selections from natural numbers repeated = A008619 is equal to A086602 (observed by Alois P. Heinz).
The number of ordered (1,1)-selections from natural numbers repeated = A008619 is equal to the squares = A000290.
The number of ordered (1,1)-selections from the natural numbers = A000027 ("[1,2,3,...,n]-multiset") is equal to the Oblong numbers = A002378.
The number of ordered (2,2)-selections from the natural numbers = A000027 ("[1,2,3,...,n]-multiset") is equal to A033487.
The number of (not ordered) (1,1)-selections from the natural numbers = A000027 ("[1,2,3,...,n]-multiset") is equal to the triangular numbers = A000217.
The number of (not ordered) (2,2)-selections from the natural numbers = A000027 ("[1,2,3,...,n]-multiset") is equal to the tritriangular numbers = A050534.
For n>0, the terms of this sequence are related to A014209 by a(n) = sum( i*A014209(i), i=0..n-1 ). [Bruno Berselli, Dec 20 2013]

Examples

			Example: For n=3 there are 21 ordered selections of the type (2,2):
[[1,1],[2,2]], [[1,2],[1,2]], [[2,2],[1,1]], [[1,2],[2,3]],
[[1,3],[2,2]], [[2,2],[1,3]], [[2,3],[1,2]], [[1,1],[2,3]],
[[1,2],[1,3]], [[1,3],[1,2]], [[2,3],[1,1]], [[1,1],[3,3]],
[[1,3],[1,3]], [[3,3],[1,1]], [[1,2],[3,3]], [[1,3],[2,3]],
[[2,3],[1,3]], [[3,3],[1,2]], [[2,2],[3,3]], [[2,3],[2,3]],
[[3,3],[2,2]].
		

Crossrefs

Cf. A014209.

Programs

  • Mathematica
    Table[n*(n + 4)*(n - 1)^2/4, {n, 0, 100}] (* Vincenzo Librandi, Oct 18 2012 *)

Formula

a(n) = n*(n+4)*(n-1)^2/4.
G.f.: 3*x^2*(x^2-2*x-1) / (x-1)^5.

A180174 Triangle read by rows of the numbers C(n,k) of k-subsets of a quadratically populated n-multiset M.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 3, 5, 7, 9, 10, 10, 10, 10, 10, 9, 7, 5, 3, 1, 1, 4, 9, 16, 25, 35, 45, 55, 65, 75, 84, 91, 96, 99, 100, 100, 100, 99, 96, 91, 84, 75, 65, 55, 45, 35, 25, 16, 9, 4, 1, 1, 5, 14, 30, 55, 90, 135, 190, 255, 330, 414, 505, 601, 700, 800, 900, 1000, 1099
Offset: 0

Author

Thomas Wieder, Aug 15 2010

Keywords

Comments

The multiplicity m(i) of the i-th element with 1 <= i <= n is m(i)=i^2.
Thus M=[1,2,2,2,2,...,i^2 x i,...,n^2 x n].
Row sum is equal to A028361.
Column for k=2 is equal to AA000096.
Column for k=3 is equal to AA005581.
Column for k=4 is equal to AA005582.
The number of coefficients C(n,k) for given n is equal to A056520.

Examples

			For n=4 one has M=[1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4].
For k=7 we have 55 subsets from M:
[1, 2, 2, 3, 3, 4, 4], [1, 2, 3, 3, 4, 4, 4], [1, 2, 3, 3, 3, 4, 4],
[1, 2, 2, 3, 4, 4, 4], [1, 2, 2, 3, 3, 3, 4], [1, 2, 2, 2, 3, 4, 4],
[1, 2, 2, 2, 3, 3, 4], [2, 2, 3, 3, 4, 4, 4], [2, 2, 3, 3, 3, 4, 4],
[2, 2, 2, 3, 3, 4, 4], [1, 2, 2, 2, 3, 3, 3], [1, 2, 2, 2, 4, 4, 4],
[1, 3, 3, 3, 4, 4, 4], [2, 3, 3, 3, 4, 4, 4], [2, 2, 2, 3, 4, 4, 4],
[2, 2, 2, 3, 3, 3, 4], [1, 2, 3, 4, 4, 4, 4], [1, 2, 3, 3, 3, 3, 4],
[1, 2, 2, 2, 2, 3, 4], [1, 2, 2, 3, 3, 3, 3], [1, 2, 2, 2, 2, 3, 3],
[1, 2, 2, 4, 4, 4, 4], [1, 2, 2, 2, 2, 4, 4], [1, 3, 3, 4, 4, 4, 4],
[1, 3, 3, 3, 3, 4, 4], [2, 3, 3, 4, 4, 4, 4], [2, 3, 3, 3, 3, 4, 4],
[2, 2, 3, 4, 4, 4, 4], [2, 2, 3, 3, 3, 3, 4], [2, 2, 2, 2, 3, 4, 4],
[2, 2, 2, 2, 3, 3, 4], [2, 2, 2, 3, 3, 3, 3], [2, 2, 2, 2, 3, 3, 3],
[2, 2, 2, 4, 4, 4, 4], [2, 2, 2, 2, 4, 4, 4], [3, 3, 3, 4, 4, 4, 4],
[3, 3, 3, 3, 4, 4, 4], [1, 2, 3, 3, 3, 3, 3], [1, 2, 4, 4, 4, 4, 4],
[1, 3, 4, 4, 4, 4, 4], [1, 3, 3, 3, 3, 3, 4], [2, 3, 4, 4, 4, 4, 4],
[2, 3, 3, 3, 3, 3, 4], [2, 2, 3, 3, 3, 3, 3], [2, 2, 4, 4, 4, 4, 4],
[3, 3, 4, 4, 4, 4, 4], [3, 3, 3, 3, 3, 4, 4], [1, 3, 3, 3, 3, 3, 3],
[1, 4, 4, 4, 4, 4, 4], [2, 3, 3, 3, 3, 3, 3], [2, 4, 4, 4, 4, 4, 4],
[3, 4, 4, 4, 4, 4, 4], [3, 3, 3, 3, 3, 3, 4], [3, 3, 3, 3, 3, 3, 3],
[4, 4, 4, 4, 4, 4, 4].
		

Programs

  • Maple
    with(combinat)
    kend := 4;
    Liste := NULL;
    for k from 0 to kend do
    Liste := Liste, `$`(k, k^2)
    end do;
    Liste := [Liste];
    for k from 0 to 2^(kend+1)-1 do
    Teilergebnis[k] := choose(Liste, k)
    end do;
    seq(nops(Teilergebnis[k]), k = 0 .. 2^(kend+1)-1)
    ' Excel VBA
    Sub A180174()
    Dim n As Long, nend As Long, k As Long, kk As Long, length_row As Long, length_sum As Long
    Dim ATable(10, -1000 To 1000) As Double, Summe As Double
    Dim offset_row As Integer, offset_column As Integer
    Worksheets("Tabelle2").Select
    Cells.Select
    Selection.ClearContents
    Range("A1").Select
    offset_row = 1
    offset_column = 1
    nend = 7
    ATable(0, 0) = 1
    Cells(0 + offset_row, 0 + offset_column) = 1
    For n = 1 To nend
    length_row = n * (n + 1) * (2 * n + 1) / 6
    length_sum = n ^ 2 + 1
    For k = 0 To length_row / 2
    Summe = 0
    For kk = k - length_sum + 1 To k
    Summe = Summe + ATable(n - 1, kk)
    Next kk
    ATable(n, k) = Summe
    Cells(n + offset_row, k + offset_column) = ATable(n, k)
    ATable(n, length_row - k) = Summe
    Cells(n + offset_row, length_row - k + 0 + offset_column) = ATable(n, k)
    Next k
    Next n
    End Sub

Formula

C(0,0) = 0.
C(n,k) = sum_{j=(k-LS+1)}^{k} C(n-1,j).
for n > 0 and k=1,...,LR with LS = n^2+1 and LR = n*(n+1)*(2*n+1)/6.
C(n,k) = C(n,LR-k).

A165984 Number of ways to put n indistinguishable balls into n^3 distinguishable boxes.

Original entry on oeis.org

1, 1, 36, 3654, 766480, 275234400, 151111164204, 117774526188844, 123672890985095232, 168324948170849366820, 288216356245328994082600, 606320062786763763996747618, 1537230010624231669678572481296, 4622745700243196227504110670860680
Offset: 0

Author

Thomas Wieder, Oct 03 2009

Keywords

Comments

See A165817 for the case n indistinguishable balls into 2*n distinguishable boxes.
See A054688 for the case n indistinguishable balls into n^2 distinguishable boxes.
a(n) is the number of (weak) compositions of n into n^3 parts. - Joerg Arndt, Oct 04 2017

Examples

			For n = 2 the a(2) = 36 solutions are
[0, 0, 0, 0, 0, 0, 0, 2]
[0, 0, 0, 0, 0, 0, 1, 1]
[0, 0, 0, 0, 0, 0, 2, 0]
[0, 0, 0, 0, 0, 1, 0, 1]
[0, 0, 0, 0, 0, 1, 1, 0]
[0, 0, 0, 0, 0, 2, 0, 0]
[0, 0, 0, 0, 1, 0, 0, 1]
[0, 0, 0, 0, 1, 0, 1, 0]
[0, 0, 0, 0, 1, 1, 0, 0]
[0, 0, 0, 0, 2, 0, 0, 0]
[0, 0, 0, 1, 0, 0, 0, 1]
[0, 0, 0, 1, 0, 0, 1, 0]
[0, 0, 0, 1, 0, 1, 0, 0]
[0, 0, 0, 1, 1, 0, 0, 0]
[0, 0, 0, 2, 0, 0, 0, 0]
[0, 0, 1, 0, 0, 0, 0, 1]
[0, 0, 1, 0, 0, 0, 1, 0]
[0, 0, 1, 0, 0, 1, 0, 0]
[0, 0, 1, 0, 1, 0, 0, 0]
[0, 0, 1, 1, 0, 0, 0, 0]
[0, 0, 2, 0, 0, 0, 0, 0]
[0, 1, 0, 0, 0, 0, 0, 1]
[0, 1, 0, 0, 0, 0, 1, 0]
[0, 1, 0, 0, 0, 1, 0, 0]
[0, 1, 0, 0, 1, 0, 0, 0]
[0, 1, 0, 1, 0, 0, 0, 0]
[0, 1, 1, 0, 0, 0, 0, 0]
[0, 2, 0, 0, 0, 0, 0, 0]
[1, 0, 0, 0, 0, 0, 0, 1]
[1, 0, 0, 0, 0, 0, 1, 0]
[1, 0, 0, 0, 0, 1, 0, 0]
[1, 0, 0, 0, 1, 0, 0, 0]
[1, 0, 0, 1, 0, 0, 0, 0]
[1, 0, 1, 0, 0, 0, 0, 0]
[1, 1, 0, 0, 0, 0, 0, 0]
[2, 0, 0, 0, 0, 0, 0, 0]
		

Crossrefs

Programs

  • Maple
    a:= n-> binomial(n^3+n-1, n): seq(a(n), n=0..16);
  • Mathematica
    Table[Binomial[n^3 + n - 1, n], {n, 0, 13}] (* Michael De Vlieger, Oct 05 2017 *)
  • PARI
    a(n) = binomial(n^3+n-1, n); \\ Altug Alkan, Oct 03 2017

Formula

a(n) = binomial(n^3+n-1, n).
Let denote P(n) = the number of integer partitions of n,
p(i) = the number of parts of the i-th partition of n,
d(i) = the number of different parts of the i-th partition of n,
m(i,j) = multiplicity of the j-th part of the i-th partition of n.
Then one has:
a(n) = Sum_{i=1..P(n)} (n^3)!/((n^3-p(i))!*(Product_{j=1..d(i)} m(i,j)!)).
a(n) = [x^n] 1/(1 - x)^(n^3). - Ilya Gutkovskiy, Oct 03 2017

A173009 Expansion of o.g.f. x*(1 - x + x^2)/(1 -3*x +x^2 +3*x^3 -2*x^4).

Original entry on oeis.org

0, 1, 2, 6, 13, 29, 60, 124, 251, 507, 1018, 2042, 4089, 8185, 16376, 32760, 65527, 131063, 262134, 524278, 1048565, 2097141, 4194292, 8388596, 16777203, 33554419, 67108850, 134217714, 268435441, 536870897
Offset: 1

Author

Thomas Wieder, Feb 07 2010

Keywords

Comments

The mean value m(n) = Sum_{k=0..(2^n -n-1)} k*p(n,k) of the distribution function p(n,k) = binomial(2^n-n-1, k)/2^(2^n-n-1) is 0., 0.5, 2., 5.5, 13., 28.5, 60., 123.5, 251., 506.5, 1018., 2041.5, 4089., 8184.5... We set a(n) = round(m(n)).
The half-integer sequence h(n) = 0, 1/2, 2, 11/2, 13, 57/2, 60, 247/2, 251, 1013/2, 1018, 4083/2, 4089, 16369/2, 16376, 65519/2, 65527, ... is the binomial transform of 0, 1/2, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...

Crossrefs

Programs

  • Magma
    [Round((2^n -n-1)/2): n in [1..40]]; // G. C. Greubel, Feb 20 2021
  • Maple
    A173009:= n-> round((2^n -n-1)/2); seq(A173009(n), n=1..40); # G. C. Greubel, Feb 20 2021
  • Mathematica
    Table[Ceiling[(2^n-n-1)/2],{n,30}] (* or *) LinearRecurrence[{3,-1,-3,2},{0,1,2,6},30] (* Harvey P. Dale, Nov 16 2011 *)
  • PARI
    a(n)=([0,1,0,0; 0,0,1,0; 0,0,0,1; 2,-3,-1,3]^(n-1)*[0;1;2;6])[1,1] \\ Charles R Greathouse IV, Apr 18 2020
    
  • Sage
    [round((2^n -n-1)/2) for n in (1..40)] # G. C. Greubel, Feb 20 2021
    

Formula

G.f.: x*(1 - x + x^2)/(1 -3*x +x^2 +3*x^3 -2*x^4).
m(n) = (1/4)*2^n - 1/2 + m*(n-1) with m(1)=0 and a(n) = round(m(n)).
a(1)=0, a(2)=1, a(3)=2, a(4)=6, a(n) = 3*a(n-1) -a(n-2) -3*a(n-3) +2*a(n-4). - Harvey P. Dale, Nov 16 2011
a(n) = round(A000295(n)/2). - G. C. Greubel, Feb 20 2021

A173010 a(n) = round((2^n - n - 1)/4).

Original entry on oeis.org

0, 0, 1, 3, 7, 14, 30, 62, 126, 253, 509, 1021, 2045, 4092, 8188, 16380, 32764, 65531, 131067, 262139, 524283, 1048570, 2097146, 4194298, 8388602, 16777209, 33554425, 67108857, 134217721, 268435448, 536870904, 1073741816, 2147483640
Offset: 1

Author

Thomas Wieder, Feb 07 2010

Keywords

Comments

The variance v(n) = Sum_{k=0..2^n-n-1} (k - m(n))^2*p(n,k) of the distribution function p(n,k) = binomial(2^n -n-1, k)/2^(2^n -n-1) with m(n) its mean value is 0., 0.25, 1., 2.75, 6.5, 14.25, 30., 61.75, 125.5, 253.25, 509., 1020.75, 2044.5, 4092.25, 8188... We set a(n) = round(v(n)).

Crossrefs

Programs

  • Magma
    [Round((2^n -n-1)/4): n in [1..40]]; // G. C. Greubel, Feb 20 2021
  • Maple
    A173010:= round((2^n -n-1)/4); seq(A173010(n), n=1..40); # G. C. Greubel, Feb 20 2021
  • Mathematica
    nn:=33; Rest[CoefficientList[Series[x^3*(1-x^3+x^4)/(1-3*x+2*x^2-2*x^6-x^4+3*x^5),{x,0,nn}],x]] (* Georg Fischer, Apr 17 2020 *)
    LinearRecurrence[{3,-2,0,1,-3,2},{0,0,1,3,7,14,30},40] (* Harvey P. Dale, Feb 06 2023 *)
  • Sage
    [round((2^n -n -1)/4) for n in (1..40)] # G. C. Greubel, Feb 20 2021
    

Formula

a(n) = round((2^n -n -1)/4).
G.f.: x^3*(1 -x^3 +x^4)/(1 -3*x +2*x^2 -x^4 +3*x^5 -2*x^6). [sign corrected by Georg Fischer, Apr 17 2020]
v(n) = (1/8)*2^n -1/4 + v(-1+n) with v(1) = 0 and a(n) = round(v(n)).
a(n) = round(A000295(n)/4). - G. C. Greubel, Feb 20 2021

Extensions

Edited by Georg Fischer and Joerg Arndt, Apr 17 2020

A158497 Triangle T(n,k) formed by the coordination sequences and the number of leaves for trees.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 3, 6, 12, 1, 4, 12, 36, 108, 1, 5, 20, 80, 320, 1280, 1, 6, 30, 150, 750, 3750, 18750, 1, 7, 42, 252, 1512, 9072, 54432, 326592, 1, 8, 56, 392, 2744, 19208, 134456, 941192, 6588344, 1, 9, 72, 576, 4608, 36864, 294912, 2359296, 18874368, 150994944, 1, 10, 90, 810, 7290, 65610, 590490, 5314410, 47829690, 430467210, 3874204890
Offset: 0

Author

Thomas Wieder, Mar 20 2009

Keywords

Comments

Consider the k-fold Cartesian products CP(n,k) of the vector A(n) = [1, 2, 3, ..., n].
An element of CP(n,k) is a n-tuple T_t of the form T_t = [i_1, i_2, i_3, ..., i_k] with t=1, .., n^k.
We count members T of CP(n,k) which satisfy some condition delta(T_t), so delta(.) is an indicator function which attains values of 1 or 0 depending on whether T_t is to be counted or not; the summation sum_{CP(n,k)} delta(T_t) over all elements T_t of CP produces the count.
For the triangle here we have delta(T_t) = 0 if for any two i_j, i_(j+1) in T_t one has i_j = i_(j+1): T(n,k) = Sum_{CP(n,k)} delta(T_t) = Sum_{CP(n,k)} delta(i_j = i_(j+1)).
The test on i_j > i_(j+1) generates A158498. One gets the Pascal triangle A007318 if the indicator function tests whether for any two i_j, i_(j+1) in T_t one has i_j >= i_(j+1).
Use of other indicator functions can also calculate the Bell numbers A000110, A000045 or A000108.

Examples

			Array, A(n, k) = n*(n-1)^(k-1) for n > 1, A(n, k) = 1 otherwise, begins as:
  1,  1,   1,    1,     1,      1,       1,        1,        1, ... A000012;
  1,  1,   1,    1,     1,      1,       1,        1,        1, ... A000012;
  1,  2,   2,    2,     2,      2,       2,        2,        2, ... A040000;
  1,  3,   6,   12,    24,     48,      96,      192,      384, ... A003945;
  1,  4,  12,   36,   108,    324,     972,     2916,     8748, ... A003946;
  1,  5,  20,   80,   320,   1280,    5120,    20480,    81920, ... A003947;
  1,  6,  30,  150,   750,   3750,   18750,    93750,   468750, ... A003948;
  1,  7,  42,  252,  1512,   9072,   54432,   326592,  1959552, ... A003949;
  1,  8,  56,  392,  2744,  19208,  134456,   941192,  6588344, ... A003950;
  1,  9,  72,  576,  4608,  36864,  294912,  2359296, 18874368, ... A003951;
  1, 10,  90,  810,  7290,  65610,  590490,  5314410, 47829690, ... A003952;
  1, 11, 110, 1100, 11000, 110000, 1100000, 11000000, ............. A003953;
  1, 12, 132, 1452, 15972, 175692, 1932612, 21258732, ............. A003954;
  1, 13, 156, 1872, 22464, 269568, 3234816, 38817792, ............. A170732;
  ... ;
The triangle begins as:
  1
  1, 1;
  1, 2,  2;
  1, 3,  6,  12;
  1, 4, 12,  36,  108;
  1, 5, 20,  80,  320,  1280;
  1, 6, 30, 150,  750,  3750,  18750;
  1, 7, 42, 252, 1512,  9072,  54432, 326592;
  1, 8, 56, 392, 2744, 19208, 134456, 941192, 6588344;
  ...;
T(3,3) = 12 counts the triples (1,2,1), (1,2,3), (1,3,1), (1,3,2), (2,1,2), (2,1,3), (2,3,1), (2,3,2), (3,1,2), (3,1,3), (3,2,1), (3,2,3) out of a total of 3^3 = 27 triples in the CP(3,3).
		

Crossrefs

Array rows n: A170733 (n=14), ..., A170769 (n=50).
Columns k: A000012(n) (k=0), A000027(n) (k=1), A002378(n-1) (k=2), A011379(n-1) (k=3), A179824(n) (k=4), A101362(n-1) (k=5), 2*A168351(n-1) (k=6), 2*A168526(n-1) (k=7), 2*A168635(n-1) (k=8), 2*A168675(n-1) (k=9), 2*A170783(n-1) (k=10), 2*A170793(n-1) (k=11).
Diagonals k: A055897 (k=n), A055541 (k=n-1), A373395 (k=n-2), A379612 (k=n-3).
Sums: (-1)^n*A065440(n) (signed row).

Programs

  • Magma
    A158497:= func< n,k | k le 1 select n^k else n*(n-1)^(k-1) >;
    [A158497(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Mar 18 2025
    
  • Mathematica
    A158497[n_, k_]:= If[n<2 || k==0, 1, n*(n-1)^(k-1)];
    Table[A158497[n,k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Mar 18 2025 *)
  • SageMath
    def A158497(n,k): return n^k if k<2 else n*(n-1)^(k-1)
    print(flatten([[A158497(n,k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Mar 18 2025

Formula

T(n, k) = (n-1)^(k-1) + (n-1)^k = n*A079901(n-1,k-1), k > 0.
Sum_{k=0..n} T(n,k) = (n*(n-1)^n - 2)/(n-2), n > 2.

Extensions

Edited by R. J. Mathar, Mar 31 2009
More terms added by G. C. Greubel, Mar 18 2025

A165817 Number of compositions (= ordered integer partitions) of n into 2n parts.

Original entry on oeis.org

1, 2, 10, 56, 330, 2002, 12376, 77520, 490314, 3124550, 20030010, 129024480, 834451800, 5414950296, 35240152720, 229911617056, 1503232609098, 9847379391150, 64617565719070, 424655979547800, 2794563003870330, 18412956934908690, 121455445321173600
Offset: 0

Author

Thomas Wieder, Sep 29 2009

Keywords

Comments

Number of ways to put n indistinguishable balls into 2*n distinguishable boxes.
Number of rankings of n unlabeled elements for 2*n levels.

Examples

			Let [1,1,1], [1,2] and [3] be the integer partitions of n=3.
Then [0,0,0,1,1,1], [0,0,0,0,1,2] and [0,0,0,0,0,3] are the corresponding partitions occupying 2*n = 6 positions.
We have to take into account the multiplicities of the parts including the multiplicities of the zeros.
Then
  [0,0,0,1,1,1] --> 6!/(3!*3!) = 20
  [0,0,0,0,1,2] --> 6!/(4!*1!*1!) = 30
  [0,0,0,0,0,3] --> 6!/(5!*1!) = 6
and thus a(3) = 20+30+6=56.
a(2)=10, since we have 10 ordered partitions of n=2 where the parts are distributed over 2*n=4 boxes:
  [0, 0, 0, 2]
  [0, 0, 1, 1]
  [0, 0, 2, 0]
  [0, 1, 0, 1]
  [0, 1, 1, 0]
  [0, 2, 0, 0]
  [1, 0, 0, 1]
  [1, 0, 1, 0]
  [1, 1, 0, 0]
  [2, 0, 0, 0].
		

Programs

  • Magma
    [Binomial(3*n-1, n): n in [0..30]]; // Vincenzo Librandi, Aug 07 2014
    
  • Maple
    for n from 0 to 16 do
    a[n] := 9*sqrt(3)*GAMMA(n+5/3)*GAMMA(n+4/3)*27^n/(Pi*GAMMA(2*n+3))
    end do;
  • Mathematica
    Table[Binomial[3 n - 1, n], {n, 0, 20}] (* Vincenzo Librandi, Aug 07 2014 *)
  • PARI
    vector(30, n, n--; binomial(3*n-1, n)) \\ Altug Alkan, Nov 04 2015
    
  • Python
    from math import comb
    def A165817(n): return comb(3*n-1,n) if n else 1 # Chai Wah Wu, Oct 11 2023
  • Sage
    def A165817(n):
        return rising_factorial(2*n,n)/falling_factorial(n,n)
    [A165817(n) for n in (0..22)]   # Peter Luschny, Nov 21 2012
    

Formula

a(n) = 9*sqrt(3)*GAMMA(n+5/3)*GAMMA(n+4/3)*27^n/(Pi*GAMMA(2*n+3)).
a(n) = binomial(3*n-1, n);
Let denote P(n) = the number of integer partitions of n,
p(i) = the number of parts of the i-th partition of n,
d(i) = the number of different parts of the i-th partition of n,
m(i,j) = multiplicity of the j-th part of the i-th partition of n.
Then one has:
a(n) = Sum_{i=1..P(n)} (2*n)!/((2*n-p(i))!*(Prod_{j=1..d(i)} m(i,j)!)).
a(n) = rf(2*n,n)/ff(n,n), where rf is the rising factorial and ff the falling factorial. - Peter Luschny, Nov 21 2012
G.f.: A(x) = x*B'(x)/B(x), where B(x) satisfies B(x)^3-2*B(x)^2+B(x)=x, B(x)=A006013(x). - Vladimir Kruchinin, Feb 06 2013
G.f.: A(x) = sqrt(3*x)*cot(asin((3^(3/2)*sqrt(x))/2)/3)/(sqrt(4-27*x)). - Vladimir Kruchinin, Mar 18 2015
a(n) = Sum_{k=0..n} binomial(n-1,n-k)*binomial(2*n,k). - Vladimir Kruchinin, Oct 06 2015
From Peter Bala, Nov 04 2015: (Start)
The o.g.f. equals f(x)/g(x), where f(x) is the o.g.f. for A005809 and g(x) is the o.g.f. for A001764. More generally, f(x)*g(x)^k is the o.g.f. for the sequence binomial(3*n + k,n). Cf. A045721 (k = 1), A025174 (k = 2), A004319 (k = 3), A236194 (k = 4), A013698 (k = 5) and A117671 (k = -2). (End)
a(n) = [x^n] 1/(1 - x)^(2*n). - Ilya Gutkovskiy, Oct 03 2017
a(n) = A059481(2n,n). - Alois P. Heinz, Oct 17 2022
From Peter Bala, Feb 14 2024: (Start)
a(n) = (-1)^n * binomial(-2*n, n).
a(n) = hypergeom([1 - 2*n, -n], [1], 1).
The g.f. A(x) satisfies A(x/(1 + x)^3) = 1/(1 - 2*x).
Sum_{n >= 0} a(n)/9^n = (1 + 4*cos(Pi/9))/3.
Sum_{n >= 0} a(n)/27^n = (3 + 4*sqrt(3)*cos(Pi/18))/9.
Sum_{n >= 0} a(n)*(2/27)^n = (2 + sqrt(3))/3. (End)
From Peter Bala, Sep 16 2024: (Start)
a(n) = Sum_{k = 0..n} binomial(n+k-1, k)*binomial(2*n-k-1, n-k).
More generally, a(n) = Sum_{k = 0..n} (-1)^k*binomial(x*n, k)*binomial((x+3)*n-k-1, n-k) for arbitrary x.
a(n) = (2/3) * Sum_{k = 0..n} (-1)^k*binomial(x*n+k-1, k)*binomial((x+3)*n, n-k) for n >= 1 and arbitrary x. (End)
G.f.: 1/(3-2*g) where g = 1+x*g^3 is the g.f. of A001764. - Seiichi Manyama, Aug 17 2025

Extensions

a(0) prepended and more terms from Alois P. Heinz, Apr 04 2012