A220832 Erroneous version of A007827.
1, 3, 5, 12, 31, 83, 233, 670, 1981, 5966
Offset: 1
Keywords
Links
- V. P. Johnson, Enumeration Results on Leaf Labeled Trees, Ph. D. Dissertation, Univ. Southern Calif., 2012.
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.
--------------- Examples (i=internal,e=external): --------------------------- |.n=2.|..n=4..|..n=5..|...n=6.............|....n=7..........................| |.....|.......|.......|.............e...e.|................e.e.e......e...e.| |.....|.e...e.|.e.e.e.|.e.e.e.e...e...i...|.e.e.e.e.e...e....i....e.e...i...| |..e..|...i...|...i...|....i........i.....|.....i..........i..........i.....| |..e..|...e...|...e...|....e........e.....|.....e..........e..........e.....| ----------------------------------------------------------------------------- G.f. = x^2 + x^4 + x^5 + 2*x^6 + 3*x^7 + 6*x^8 + 10*x^9 + 19*x^10 + ... From _Joerg Arndt_, Jun 28 2014: (Start) The a(8) = 6 rooted trees with 7 nodes as described in the comment are: : level sequence out-degrees (dots for zeros) : 1: [ 0 1 2 3 3 2 1 ] [ 2 2 2 . . . . ] : O--o--o--o : .--o : .--o : .--o : : 2: [ 0 1 2 2 2 2 1 ] [ 2 4 . . . . . ] : O--o--o : .--o : .--o : .--o : .--o : : 3: [ 0 1 2 2 2 1 1 ] [ 3 3 . . . . . ] : O--o--o : .--o : .--o : .--o : .--o : : 4: [ 0 1 2 2 1 2 2 ] [ 2 2 . . 2 . . ] : O--o--o : .--o : .--o--o : .--o : : 5: [ 0 1 2 2 1 1 1 ] [ 4 2 . . . . . ] : O--o--o : .--o : .--o : .--o : .--o : : 6: [ 0 1 1 1 1 1 1 ] [ 6 . . . . . . ] : O--o : .--o : .--o : .--o : .--o : .--o : (End) From _Gus Wiseman_, Jan 20 2020: (Start) The a(2) = 1 through a(9) = 10 unlabeled lone-child-avoiding rooted trees with n - 1 nodes (empty n = 3 column shown as dot) are: o . (oo) (ooo) (oooo) (ooooo) (oooooo) (ooooooo) (o(oo)) (o(ooo)) (o(oooo)) (o(ooooo)) (oo(oo)) (oo(ooo)) (oo(oooo)) (ooo(oo)) (ooo(ooo)) ((oo)(oo)) (oooo(oo)) (o(o(oo))) ((oo)(ooo)) (o(o(ooo))) (o(oo)(oo)) (o(oo(oo))) (oo(o(oo))) (End)
with (powseries): with (combstruct): n := 30: sys := {B = Prod(C,Z), S = Set(B,1 <= card), C = Union(Z,S)}: A001678 := 1,0,1,seq(count([S, sys, unlabeled],size=i),i=1..n); # Ulrich Schimke (ulrschimke(AT)aol.com) # second Maple program: with(numtheory): b:= proc(n) option remember; `if`(n=0, 1, add(add( d*a(d+1), d=divisors(j))*b(n-j), j=1..n)/n) end: a:= proc(n) option remember; `if`(n<2, 0, `if`(n=2, 1, b(n-2)-a(n-1))) end: seq(a(n), n=0..50); # Alois P. Heinz, Jul 02 2014
b[n_] := b[n] = If[n == 0, 1, Sum[Sum[d*a[d+1], {d, Divisors[j]}]*b[n-j], {j, 1, n}]/n]; a[n_] := a[n] = If[n < 2, 0, If[n == 2, 1, b[n-2] - a[n-1]]]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Sep 24 2014, after Alois P. Heinz *) terms = 38; A[] = 0; Do[A[x] = (x^2/(1+x))*Exp[Sum[A[x^k]/(k*x^k), {k, 1, j}]] + O[x]^j // Normal, {j, 1, terms}]; CoefficientList[A[x], x] (* Jean-François Alcover, Jan 12 2018 *) urt[n_]:=Join@@Table[Union[Sort/@Tuples[urt/@ptn]],{ptn,IntegerPartitions[n-1]}]; Table[If[n<=1,0,Length[Select[urt[n-1],FreeQ[#,{}]&]]],{n,0,10}] (* _Gus Wiseman, Jan 20 2020 *)
(a(n) = if( n<4, n==2, T(n-2, n-3))); /* where */ {T(n, k) = if( n<1 || k<1, (n==0) && (k>=0), sum(j=1, k, sum(i=1, n\j, T(n-i*j, min(n-i*j, j-1)) * binomial( a(j+1) + i-1, i))))}; /* Michael Somos, Jun 04 2002 */
{a(n) = local(A); if( n<3, n==2, A = x / (1 - x^2) + O(x^n); for(k=3, n-2, A /= (1 - x^k + O(x^n))^polcoeff(A, k)); polcoeff(A, n-1))}; /* Michael Somos, Oct 06 2003 */
G.f. = x + x^2 + 2*x^3 + 5*x^4 + 12*x^5 + 33*x^6 + 90*x^7 + 261*x^8 + ... a(4)=5 with the following series-reduced planted trees: (oooo), (oo(oo)), (o(ooo)), (o(o(oo))), ((oo)(oo)). - _Michael Somos_, Jul 25 2003
Method 1: a := [1,1]; for n from 3 to 30 do L := series( mul( (1-x^k)^(-a[k]),k=1..n-1)/(1-x^n)^b, x,n+1); t1 := coeff(L,x,n); R := series( 1+2*add(a[k]*x^k,k=1..n-1)+2*b*x^n, x, n+1); t2 := coeff(R,x,n); t3 := solve(t1-t2,b); a := [op(a),t3]; od: A000669 := n-> a[n]; Method 2, more efficient: with(numtheory): M := 1001; a := array(0..M); p := array(0..M); a[1] := 1; a[2] := 1; a[3] := 2; p[1] := 1; p[2] := 3; p[3] := 7; Method 2, cont.: for m from 4 to M do t1 := divisors(m); t3 := 0; for d in t1 minus {m} do t3 := t3+d*a[d]; od: t4 := p[m-1]+2*add(p[k]*a[m-k],k=1..m-2)+t3; a[m] := t4/m; p[m] := t3+t4; od: # A000669 := n-> a[n]; A058757 := n->p[n]; # Method 3: b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0, add(binomial(a(i)+j-1, j)* b(n-i*j, i-1), j=0..n/i))) end: a:= n-> `if`(n<2, n, b(n, n-1)): seq(a(n), n=1..40); # Alois P. Heinz, Jan 28 2016
b[n_, i_] := b[n, i] = If[n==0, 1, If[i<1, 0, Sum[Binomial[a[i]+j-1, j]* b[n-i*j, i-1], {j, 0, n/i}]]]; a[n_] := If[n<2, n, b[n, n-1]]; Array[a, 40] (* Jean-François Alcover, Jan 08 2021, after Alois P. Heinz *)
{a(n) = my(A, X); if( n<2, n>0, X = x + x * O(x^n); A = 1 / (1 - X); for(k=2, n, A /= (1 - X^k)^polcoeff(A, k)); polcoeff(A, n)/2)}; /* Michael Somos, Jul 25 2003 */
from collections import Counter def A000669_list(n): list = [1] + [0] * (n - 1) for i in range(1, n): for p in Partitions(i + 1, min_length=2): m = Counter(p) list[i] += prod(binomial(list[s - 1] + m[s] - 1, m[s]) for s in m) return list print(A000669_list(20)) # M. Eren Kesim, Jun 21 2021
E.g.f.: A(x) = x + x^2/2! + 4*x^3/3! + 26*x^4/4! + 236*x^5/5! + 2752*x^6/6! + ... where exp(A(x)) = 1 - x + 2*A(x), and thus Series_Reversion(A(x)) = x - x^2/2! - x^3/3! - x^4/4! - x^5/5! - x^6/6! + ... O.g.f.: G(x) = x + x^2 + 4*x^3 + 26*x^4 + 236*x^5 + 2752*x^6 + 39208*x^7 + ... where G(x) = x/2 + x/(2*(2-x)) + x/(2*(2-x)*(2-2*x)) + x/(2*(2-x)*(2-2*x)*(2-3*x)) + x/(2*(2-x)*(2-2*x)*(2-3*x)*(2-4*x)) + x/(2*(2-x)*(2-2*x)*(2-3*x)*(2-4*x)*(2-5*x)) + ... From _Gus Wiseman_, Dec 28 2019: (Start) A rooted tree is series-reduced if it has no unary branchings, so every non-leaf node covers at least two other nodes. The a(4) = 26 series-reduced rooted trees with 4 labeled leaves are the following. Each bracket (...) corresponds to a non-leaf node. (1234) ((12)34) ((123)4) (1(23)4) (1(234)) (12(34)) ((124)3) (1(24)3) ((134)2) ((13)24) (((12)3)4) ((14)23) ((1(23))4) ((12)(34)) (1((23)4)) (1(2(34))) (((12)4)3) ((1(24))3) (1((24)3)) (((13)2)4) ((13)(24)) (((13)4)2) ((1(34))2) (((14)2)3) ((14)(23)) (((14)3)2) (End)
M:=499; a:=array(0..500); a[0]:=0; a[1]:=1; a[2]:=1; for n from 0 to 2 do lprint(n,a[n]); od: for n from 2 to M do a[n+1]:=(n+2)*a[n]+2*add(binomial(n,k)*a[k]*a[n-k+1],k=2..n-1); lprint(n+1,a[n+1]); od: Order := 50; t1 := solve(series((exp(A)-2*A-1),A)=-x,A); A000311 := n-> n!*coeff(t1,x,n); # second Maple program: b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0, add(combinat[multinomial](n, n-i*j, i$j)/j!* a(i)^j*b(n-i*j, i-1), j=0..n/i))) end: a:= n-> `if`(n<2, n, b(n, n-1)): seq(a(n), n=0..40); # Alois P. Heinz, Jan 28 2016 # faster program: b:= proc(n, i) option remember; `if`(i=0 and n=0, 1, `if`(i<=0 or i>n, 0, i*b(n-1, i) + (n+i-1)*b(n-1, i-1))) end: a:= n -> `if`(n<2, n, add(b(n-1, i), i=0..n-1)): seq(a(n), n=0..40); # Peter Luschny, Feb 15 2021
nn = 19; CoefficientList[ InverseSeries[ Series[1+2a-E^a, {a, 0, nn}], x], x]*Range[0, nn]! (* Jean-François Alcover, Jul 21 2011 *) a[ n_] := If[ n < 1, 0, n! SeriesCoefficient[ InverseSeries[ Series[ 1 + 2 x - Exp[x], {x, 0, n}]], n]]; (* Michael Somos, Jun 04 2012 *) a[n_] := (If[n < 2,n,(column = ConstantArray[0, n - 1]; column[[1]] = 1; For[j = 3, j <= n, j++, column = column * Flatten[{Range[j - 2], ConstantArray[0, (n - j) + 1]}] + Drop[Prepend[column, 0], -1] * Flatten[{Range[j - 1, 2*j - 3], ConstantArray[0, n - j]}];]; Sum[column[[i]], {i, n - 1}] )]); Table[a[n], {n, 0, 20}] (* Peter Regner, Oct 05 2012, after a formula by Felsenstein (1978) *) multinomial[n_, k_List] := n!/Times @@ (k!); b[n_, i_] := b[n, i] = If[n == 0, 1, If[i<1, 0, Sum[multinomial[n, Join[{n-i*j}, Array[i&,j]]]/j!*a[i]^j *b[n-i*j, i-1], {j, 0, n/i}]]]; a[n_] := If[n<2, n, b[n, n-1]]; Table[ a[n], {n, 0, 40}] (* Jean-François Alcover, Feb 07 2016, after Alois P. Heinz *) sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}]; mtot[m_]:=Prepend[Join@@Table[Tuples[mtot/@p],{p,Select[sps[m],1Gus Wiseman, Dec 28 2019 *) (* Lengthy but easy to follow *) lead[, n /; n < 3] := 0 lead[h_, n_] := Module[{p, i}, p = Position[h, {_}]; Sum[MapAt[{#, n} &, h, p[[i]]], {i, Length[p]}] ] follow[h_, n_] := Module[{r, i}, r = Replace[Position[h, {_}], {a__} -> {a, -1}, 1]; Sum[Insert[h, n, r[[i]]], {i, Length[r]}] ] marry[, n /; n < 3] := 0 marry[h_, n_] := Module[{p, i}, p = Position[h, _Integer]; Sum[MapAt[{#, n} &, h, p[[i]]], {i, Length[p]}] ] extend[a_ + b_, n_] := extend[a, n] + extend[b, n] extend[a_, n_] := lead[a, n] + follow[a, n] + marry[a, n] hierarchies[1] := hierarchies[1] = extend[hier[{}], 1] hierarchies[n_] := hierarchies[n] = extend[hierarchies[n - 1], n] (* Daniel Geisler, Aug 22 2022 *)
a(n):=if n=1 then 1 else sum((n+k-1)!*sum(1/(k-j)!*sum((2^i*(-1)^(i)*stirling2(n+j-i-1,j-i))/((n+j-i-1)!*i!),i,0,j),j,1,k),k,1,n-1); /* Vladimir Kruchinin, Jan 28 2012 */
{a(n) = local(A); if( n<0, 0, for( i=1, n, A = Pol(exp(A + x * O(x^i)) - A + x - 1)); n! * polcoeff(A, n))}; /* Michael Somos, Jan 15 2004 */
{a(n) = my(A); if( n<0, 0, A = O(x); for( i=1, n, A = intformal( 1 / (1 + x - 2*A))); n! * polcoeff(A, n))}; /* Michael Somos, Oct 25 2014 */
{a(n) = n! * polcoeff(serreverse(1+2*x - exp(x +x^2*O(x^n))), n)} for(n=0, 30, print1(a(n), ", ")) \\ Paul D. Hanna, Oct 27 2014
\p100 \\ set precision {A=Vec(sum(n=0, 600, 1.*x/prod(k=0, n, 2 - k*x + O(x^31))))} for(n=0, 25, print1(if(n<1,0,round(A[n])),", ")) \\ Paul D. Hanna, Oct 27 2014
from functools import lru_cache from math import comb @lru_cache(maxsize=None) def A000311(n): return n if n <= 1 else -(n-1)*A000311(n-1)+comb(n,m:=n+1>>1)*(0 if n&1 else A000311(m)**2) + (sum(comb(n,i)*A000311(i)*A000311(n-i) for i in range(1,m))<<1) # Chai Wah Wu, Nov 10 2022
G.f. = x + x^2 + x^4 + x^5 + 2*x^6 + 2*x^7 + 4*x^8 + 5*x^9 + 10*x^10 + ... The star graph with n nodes (except for n=3) is a series-reduced tree. For n=6 the other series-reduced tree is shaped like the letter H. - _Michael Somos_, Dec 19 2014
with(powseries): with(combstruct): n := 30: Order := n+3: sys := {B = Prod(C,Z), S = Set(B,1 <= card), C = Union(Z,S)}: G001678 := (convert(gfseries(sys,unlabeled,x) [S(x)], polynom)) * x^2: G0temp := G001678 + x^2: G059123 := G0temp / x + G0temp - (G0temp^2+eval(G0temp,x=x^2))/(2*x): G000014 := ((x-1)/x) * G059123 + ((1+x)/x^2) * G0temp - (1/x^2) * G0temp^2: A000014 := 0,seq(coeff(G000014,x^i),i=1..n); # Ulrich Schimke (ulrschimke(AT)aol.com)
a[n_] := If[n<1, 0, A = x/(1-x^2) + x*O[x]^n; For[k=3, k <= n-1, k++, A = A/(1 - x^k + x*O[x]^n)^SeriesCoefficient[A, k]]; s = ((Normal[A] /. x -> x^2) + O[x]^(2n))*(1-x) + A*(2-A)*(1+x); SeriesCoefficient[s, n]/2]; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Feb 02 2016, adapted from PARI *)
{a(n) = my(A); if( n<1, 0, A = x / (1 - x^2) + x * O(x^n); for(k=3, n-1, A /= (1 - x^k + x * O(x^n))^polcoeff(A, k)); polcoeff( (subst(A, x, x^2) * (1 - x) + A * (2 - A) * (1 + x)) / 2, n))}; /* Michael Somos, Dec 19 2014 */
Triangle begins: 1; 0, 1; 0, 1, 1; 0, 1, 2, 1; 0, 2, 7, 9, 4; 0, 3, 24, 63, 68, 26; 0, 7, 91, 412, 812, 720, 236; 0, 13, 354, 2673, 8512, 13100, 9672, 2752; 0, 32, 1491, 17571, 84312, 199820, 248904, 156492, 39208; ...
\\ here U(n,k) is A339779 as vector. EulerT(v)={Vec(exp(x*Ser(dirmul(v, vector(#v, n, 1/n))))-1, -#v)} R(n, k)={my(v=[k]); for(n=2, n, v=concat(v, EulerT(concat(v, [0]))[n])); v} U(n, k)={my(g=x*Ser(R(n,k))); Vec(1 + g + k*x*g - g^2)} M(n, m=n)={my(v=vector(m+1, k, U(n, k-1)~)); Mat(vector(m+1, k, k--; sum(i=0, k, (-1)^(k-i)*binomial(k, i)*v[1+i])))} { my(T=M(8)); for(n=1, #T~, print(T[n,1..n])); }
Array begins: ============================================================ n\k| 0 1 2 3 4 5 6 7 ---+-------------------------------------------------------- 0 | 1 1 1 1 1 1 1 1 ... 1 | 0 1 2 3 4 5 6 7 ... 2 | 0 1 3 6 10 15 21 28 ... 3 | 0 1 4 10 20 35 56 84 ... 4 | 0 2 11 36 90 190 357 616 ... 5 | 0 3 30 144 476 1251 2814 5656 ... 6 | 0 7 105 706 3034 9845 26383 61572 ... 7 | 0 13 380 3774 21380 85995 274800 744556 ... 8 | 0 32 1555 22140 163670 812160 3086481 9692480 ... 9 | 0 73 6650 137096 1322960 8092945 36550458 132954360 ... ...
\\ here R(n,k) is k-th column of A319254. EulerT(v)={Vec(exp(x*Ser(dirmul(v, vector(#v, n, 1/n))))-1, -#v)} R(n, k)={my(v=[k]); for(n=2, n, v=concat(v, EulerT(concat(v, [0]))[n])); v} U(n, k)={my(g=x*Ser(R(n,k))); Vec(1 + g + k*x*g - g^2)} {my(T=Mat(vector(9, k, U(8, k-1)~))); for(n=1, #T~, print(T[n, ]))}
my(N=25); (U(N,2)-2*U(N,1))[2..1+N] \\ See A339780 for U(n,k).
Irregular array starts: {1}; {1}; {1, 3}; {1, 10, 15}; {1, 10, 15, 15, 15, 45, 60, 90}; {1, 21, 35, 70, 105, 105, 105, 105, 210, 315, 420, 630, 630}; {1, 28, 35, 56, 105, 168, 210, 210, 280, 280, 280, 315, 420, 420, 560, 560, 840, 840, 840, 1260, 1260, 1680, 1680, 1680, 1680, 2520, 2520, 2520, 2520, 3360, 5040, 5040}; ...
Comments