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-3 of 3 results.

A319539 Array read by antidiagonals: T(n,k) is the number of binary rooted trees with n leaves of k colors and all non-leaf nodes having out-degree 2.

Original entry on oeis.org

1, 2, 1, 3, 3, 1, 4, 6, 6, 2, 5, 10, 18, 18, 3, 6, 15, 40, 75, 54, 6, 7, 21, 75, 215, 333, 183, 11, 8, 28, 126, 495, 1260, 1620, 636, 23, 9, 36, 196, 987, 3600, 8010, 8208, 2316, 46, 10, 45, 288, 1778, 8568, 28275, 53240, 43188, 8610, 98, 11, 55, 405, 2970, 17934, 80136, 232500, 366680, 232947, 32763, 207
Offset: 1

Views

Author

Andrew Howroyd, Sep 22 2018

Keywords

Comments

Not all k colors need to be used. The total number of nodes will be 2n-1.
See table 2.1 in the Johnson reference.

Examples

			Array begins:
===========================================================
n\k|  1    2      3       4        5        6         7
---+-------------------------------------------------------
1  |  1    2      3       4        5        6         7 ...
2  |  1    3      6      10       15       21        28 ...
3  |  1    6     18      40       75      126       196 ...
4  |  2   18     75     215      495      987      1778 ...
5  |  3   54    333    1260     3600     8568     17934 ...
6  |  6  183   1620    8010    28275    80136    194628 ...
7  | 11  636   8208   53240   232500   785106   2213036 ...
8  | 23 2316  43188  366680  1979385  7960638  26037431 ...
9  | 46 8610 232947 2590420 17287050 82804806 314260765 ...
...
		

Crossrefs

Columns 1..5 are A001190, A083563, A220816, A220817, A220818.
Main diagonal is A319580.

Programs

  • Maple
    A:= proc(n, k) option remember; `if`(n<2, k*n, `if`(n::odd, 0,
          (t-> t*(1-t)/2)(A(n/2, k)))+add(A(i, k)*A(n-i, k), i=1..n/2))
        end:
    seq(seq(A(n, 1+d-n), n=1..d), d=1..12);  # Alois P. Heinz, Sep 23 2018
  • Mathematica
    A[n_, k_] := A[n, k] = If[n<2, k*n, If[OddQ[n], 0, (#*(1-#)/2&)[A[n/2, k]]] + Sum[A[i, k]*A[n-i, k], {i, 1, n/2}]];
    Table[A[n, d-n+1], {d, 1, 12}, {n, 1, d}] // Flatten (* Jean-François Alcover, Sep 02 2019, after Alois P. Heinz *)
  • PARI
    \\ here R(n,k) gives k-th column as a vector.
    R(n,k)={my(v=vector(n)); v[1]=k; for(n=2, n, v[n]=sum(j=1, (n-1)\2, v[j]*v[n-j]) + if(n%2, 0, binomial(v[n/2]+1, 2))); v}
    {my(T=Mat(vector(8, k, R(8, k)~))); for(n=1, #T~, print(T[n,]))}

Formula

T(1,k) = k.
T(n,k) = (1/2)*([n mod 2 == 0]*T(n/2,k) + Sum_{j=1..n-1} T(j,k)*T(n-j,k)).
G.f. of k-th column R(x) satisfies R(k) = k*x + (R(x)^2 + R(x^2))/2.

A319541 Triangle read by rows: T(n,k) is the number of binary rooted trees with n leaves of exactly k colors and all non-leaf nodes having out-degree 2.

Original entry on oeis.org

1, 1, 1, 1, 4, 3, 2, 14, 27, 15, 3, 48, 180, 240, 105, 6, 171, 1089, 2604, 2625, 945, 11, 614, 6333, 24180, 42075, 34020, 10395, 23, 2270, 36309, 207732, 554820, 755370, 509355, 135135, 46, 8518, 207255, 1710108, 6578550, 13408740, 14963130, 8648640, 2027025
Offset: 1

Views

Author

Andrew Howroyd, Sep 22 2018

Keywords

Comments

See table 2.2 in the Johnson reference.

Examples

			Triangle begins:
   1;
   1,    1;
   1,    4,     3;
   2,   14,    27,     15;
   3,   48,   180,    240,    105;
   6,  171,  1089,   2604,   2625,    945;
  11,  614,  6333,  24180,  42075,  34020,  10395;
  23, 2270, 36309, 207732, 554820, 755370, 509355, 135135;
  ...
		

Crossrefs

Columns 1..5 are A001190, A220819, A220820, A220821, A220822.
Main diagonal is A001147.
Row sums give A319590.

Programs

  • Maple
    A:= proc(n, k) option remember; `if`(n<2, k*n, `if`(n::odd, 0,
          (t-> t*(1-t)/2)(A(n/2, k)))+add(A(i, k)*A(n-i, k), i=1..n/2))
        end:
    T:= (n, k)-> add((-1)^i*binomial(k, i)*A(n, k-i), i=0..k):
    seq(seq(T(n, k), k=1..n), n=1..12);  # Alois P. Heinz, Sep 23 2018
  • Mathematica
    A[n_, k_] := A[n, k] = If[n<2, k n, If[OddQ[n], 0, (#(1-#)/2)&[A[n/2, k]]] + Sum[A[i, k] A[n - i, k], {i, 1, n/2}]];
    T[n_, k_] := Sum[(-1)^i Binomial[k, i] A[n, k - i], {i, 0, k}];
    Table[T[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Jean-François Alcover, Sep 02 2019, after Alois P. Heinz *)
  • PARI
    \\ here R(n,k) is k-th column of A319539 as a vector.
    R(n,k)={my(v=vector(n)); v[1]=k; for(n=2, n, v[n]=sum(j=1, (n-1)\2, v[j]*v[n-j]) + if(n%2, 0, binomial(v[n/2]+1, 2))); v}
    M(n)={my(v=vector(n, k, R(n,k)~)); Mat(vector(n, k, sum(i=1, k, (-1)^(k-i)*binomial(k,i)*v[i])))}
    {my(T=M(10)); for(n=1, #T~, print(T[n, ][1..n]))}

Formula

T(n,k) = Sum_{i=1..k} (-1)^(k-i)*binomial(k,i)*A319539(n,i).

A226909 Number of placements of brackets in a monomial of degree n in an algebra with two commutative multiplications.

Original entry on oeis.org

1, 2, 4, 14, 44, 164, 616, 2450, 9908, 41116, 173144, 739884, 3196344, 13944200, 61327312, 271653254, 1210772124, 5426133764, 24435934568, 110524288836, 501864708968, 2286937749496, 10454921456688, 47936304101860, 220383617137704, 1015714229399256
Offset: 1

Views

Author

Murray R. Bremner, Jun 21 2013

Keywords

Comments

This sequence generalizes the Wedderburn-Etherington numbers (A001190) to the case of two different types of brackets, such as square brackets [-.-] and curly brackets {-,-}.
Also number of N-free graphs [Cameron]. - Michael Somos, Apr 18 2014

Examples

			For n = 4 the 14 different bracketings are as follows:
[1[2[34]]], {1[2[34]]}, [1{2[34]}], {1{2[34]}}, [1[2{34}]], {1[2{34}]}, [1{2{34}}], {1{2{34}}}, [[12][34]], {[12][34]}, [[12]{34}], {[12]{34}}, [{12}{34}], {{12}{34}}.
G.f. = x + 2*x^2 + 4*x^3 + 14*x^4 + 44*x^5 + 164*x^6 + 616*x^7 + ...
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence as M1302, except that, copying Cameron's error, 14 is missing).

Crossrefs

Cf. Wedderburn-Etherington numbers (A001190), A241555.

Programs

  • Maple
    BBcount := table():
    BBcount[ 1 ] := 1:
    for n from 2 to 10 do
      BBcount[ n ] := 0:
    for i to floor((n-1)/2) do
        BBcount[n] := BBcount[n] + 2*BBcount[i]*BBcount[n-i]
      od:
    if n mod 2 = 0 then
        BBcount[n] := BBcount[n] + 2*binomial(BBcount[n/2]+1,2)
      fi:
    print( n, BBcount[ n ] )
    od:
  • Mathematica
    max = 26; Clear[BBcount]; BBcount[1] = 1; For[n = 2, n <= max, n++, BBcount[n] = 0; For[i = 1, i <= Floor[(n-1)/2], i++, BBcount[n] = BBcount[n] + 2*BBcount[i]*BBcount[n-i]]; If[EvenQ[n], BBcount[n] = BBcount[n] + 2*Binomial[BBcount[n/2]+1, 2]]]; Array[BBcount, max] (* Jean-François Alcover, Mar 24 2014, translated from Maple *)
  • PARI
    {a(n) = local(A); if( n<2, n>0, A = x + O(x^2); for(k=2, n, A = x + A^2 + subst(A, x, x^2)); polcoeff(A, n))}; /* Michael Somos, Jun 13 2014 */
    
  • PARI
    {a(n) = if( n<2, n>0, 2 * sum(k=1, (n-1)\2, a(k) * a(n-k)) + if( n%2==0, 2 * binomial( a(n/2) + 1, 2)))}; /* Michael Somos, Jun 13 2014 */

Formula

G.f. A(x) satisfies A(x) = x + A(x^2) + A(x)^2. - Michael Somos, Jun 13 2014
a(n) ~ c * d^n / n^(3/2), where d = 4.8925511471743497508362229157295..., c = 0.155553379207933493345508839... . - Vaclav Kotesovec, Sep 07 2014
Showing 1-3 of 3 results.