A037163 Erroneous version of A001679.
1, 2, 2, 4, 6, 12, 20, 39, 71, 137, 261, 511, 995, 1974, 3915, 7841, 15749, 31835
Offset: 0
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 */
The sequence of all lone-child-avoiding rooted trees together with their Matula-Goebel numbers begins: 1: o 4: (oo) 8: (ooo) 14: (o(oo)) 16: (oooo) 28: (oo(oo)) 32: (ooooo) 38: (o(ooo)) 49: ((oo)(oo)) 56: (ooo(oo)) 64: (oooooo) 76: (oo(ooo)) 86: (o(o(oo))) 98: (o(oo)(oo)) 106: (o(oooo)) 112: (oooo(oo)) 128: (ooooooo) 133: ((oo)(ooo)) 152: (ooo(ooo)) 172: (oo(o(oo)))
nn=2000; primeMS[n_]:=If[n===1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]; srQ[n_]:=Or[n===1,With[{m=primeMS[n]},And[Length[m]>1,And@@srQ/@m]]]; Select[Range[nn],srQ]
G.f.: A(x) = 1 + x + x^2 + 2*x^3 + 3*x^4 + 5*x^5 + 9*x^6 + 16*x^7 + 29*x^8 +... where log(A(x)) = A(x)/(1+x)*x + A(x^2)/(1+x^2)*x^2/2 + A(x^3)/(1+x^3)*x^3/3 +... The coefficients in A(x)/(1+x) begin: [1, 0, 1, 1, 2, 3, 6, 10, 19, 35, 67, 127, 248, 482, 952, 1885, 3765, ...] (this is, up to offset, A001678), from which g.f. A(x) may be generated by the Euler transform: A(x) = 1/((1-x)^1*(1-x^2)^0*(1-x^3)^1*(1-x^4)^1*(1-x^5)^2*(1-x^6)^3*(1-x^7)^6*(1-x^8)^10*(1-x^9)^19*(1-x^10)^35*...). From _Joerg Arndt_, Jun 28 2014: (Start) The a(6) = 9 rooted trees with 6 non-root nodes as described in the comment are: : level sequence out-degrees (dots for zeros) : 1: [ 0 1 2 3 3 3 2 ] [ 1 2 3 . . . . ] : O--o--o--o : .--o : .--o : .--o : : 2: [ 0 1 2 3 3 2 2 ] [ 1 3 2 . . . . ] : O--o--o--o : .--o : .--o : .--o : : 3: [ 0 1 2 3 3 2 1 ] [ 2 2 2 . . . . ] : O--o--o--o : .--o : .--o : .--o : : 4: [ 0 1 2 2 2 2 2 ] [ 1 5 . . . . . ] : O--o--o : .--o : .--o : .--o : .--o : : 5: [ 0 1 2 2 2 2 1 ] [ 2 4 . . . . . ] : O--o--o : .--o : .--o : .--o : .--o : : 6: [ 0 1 2 2 2 1 1 ] [ 3 3 . . . . . ] : O--o--o : .--o : .--o : .--o : .--o : : 7: [ 0 1 2 2 1 2 2 ] [ 2 2 . . 2 . . ] : O--o--o : .--o : .--o--o : .--o : : 8: [ 0 1 2 2 1 1 1 ] [ 4 2 . . . . . ] : O--o--o : .--o : .--o : .--o : .--o : : 9: [ 0 1 1 1 1 1 1 ] [ 6 . . . . . . ] : O--o : .--o : .--o : .--o : .--o : .--o (End) From _Gus Wiseman_, Jan 22 2020: (Start) The a(0) = 1 through a(6) = 9 rooted trees with n + 1 nodes where non-root vertices cannot have out-degree 1: o (o) (oo) (ooo) (oooo) (ooooo) (oooooo) ((oo)) ((ooo)) ((oooo)) ((ooooo)) (o(oo)) (o(ooo)) (o(oooo)) (oo(oo)) (oo(ooo)) ((o(oo))) (ooo(oo)) ((o(ooo))) ((oo)(oo)) ((oo(oo))) (o(o(oo))) (End)
with(numtheory): b:= proc(n) b(n):= `if`(n=0, 1, a(n)-b(n-1)) end: a:= proc(n) option remember; `if`(n=0, 1, add(add( d*b(d-1), d=divisors(j))*a(n-j), j=1..n)/n) end: seq(a(n), n=0..50); # Alois P. Heinz, Jul 02 2014
b[n_] := b[n] = If[n==0, 1, a[n] - b[n-1]]; a[n_] := a[n] = If[n==0, 1, Sum[Sum[d*b[d-1], {d, Divisors[j]}]*a[n-j], {j, 1, n}]/n]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Mar 21 2017, after Alois P. Heinz *) urt[n_]:=Join@@Table[Union[Sort/@Tuples[urt/@ptn]],{ptn,IntegerPartitions[n-1]}]; Table[Length[Select[urt[n],FreeQ[Z@@#,{}]&]],{n,10}] (* _Gus Wiseman, Jan 22 2020 *)
{a(n)=local(A=1+x);for(i=1,n,A=exp(sum(m=1,n,subst(A/(1+x),x,x^m+x*O(x^n))*x^m/m)));polcoeff(A,n)}
From _Gus Wiseman_, Jan 22 2020: (Start) The a(1) = 1 through a(4) = 16 trees (in the format root[branches], empty column shown as dot) are: 1 1[2] . 1[2,3,4] 2[1] 1[2[3,4]] 1[3[2,4]] 1[4[2,3]] 2[1,3,4] 2[1[3,4]] 2[3[1,4]] 2[4[1,3]] 3[1,2,4] 3[1[2,4]] 3[2[1,4]] 3[4[1,2]] 4[1,2,3] 4[1[2,3]] 4[2[1,3]] 4[3[1,2]] (End)
[1] cat [n*Factorial(n-2)*(&+[(-1)^k*Binomial(n,k)*(n-k)^(n-k-2)/Factorial(n-k-2): k in [0..n-2]]): n in [2..20]]; // G. C. Greubel, Mar 07 2020
seq( `if`(n=1, 1, n*(n-2)!*add((-1)^k*binomial(n, k)*(n-k)^(n-k-2)/(n-k-2)!, k=0..n-2)), n=1..20); # G. C. Greubel, Mar 07 2020
f[n_] := If[n < 2, 1, n(n - 2)!Sum[(-1)^k*Binomial[n, k](n - k)^(n - 2 - k)/(n - 2 - k)!, {k, 0, n - 2}]]; Table[ f[n], {n, 19}] (* Robert G. Wilson v, Feb 12 2005 *) sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}]; lrt[set_]:=If[Length[set]==0,{},Join@@Table[Apply[root,#]&/@Join@@Table[Tuples[lrt/@stn],{stn,sps[DeleteCases[set,root]]}],{root,set}]]; Table[Length[Select[lrt[Range[n]],Length[#]!=2&&FreeQ[Z@@#,Integer[]]&]],{n,6}] (* Gus Wiseman, Jan 22 2020 *)
[1]+[n*factorial(n-2)*sum((-1)^k*binomial(n,k)*(n-k)^(n-k-2)/factorial( n-k-2) for k in (0..n-2)) for n in (2..20)] # G. C. Greubel, Mar 07 2020
The a(4) = 1 through a(9) = 10 trees: (ooo) (oooo) (ooooo) (oooooo) (ooooooo) (oooooooo) (oo(oo)) (oo(ooo)) (oo(oooo)) (oo(ooooo)) (ooo(oo)) (ooo(ooo)) (ooo(oooo)) (oooo(oo)) (oooo(ooo)) (o(oo)(oo)) (ooooo(oo)) (oo(o(oo))) (o(oo)(ooo)) (oo(o(ooo))) (oo(oo)(oo)) (oo(oo(oo))) (ooo(o(oo)))
urt[n_]:=Join@@Table[Union[Sort/@Tuples[urt/@ptn]],{ptn,IntegerPartitions[n-1]}]; Table[Length[Select[urt[n],Length[#]>2&&FreeQ[#,{_}]&]],{n,10}]
The sequence of all series-reduced rooted trees with more than two branches together with their Matula-Goebel numbers begins: 8: (ooo) 16: (oooo) 28: (oo(oo)) 32: (ooooo) 56: (ooo(oo)) 64: (oooooo) 76: (oo(ooo)) 98: (o(oo)(oo)) 112: (oooo(oo)) 128: (ooooooo) 152: (ooo(ooo)) 172: (oo(o(oo))) 196: (oo(oo)(oo)) 212: (oo(oooo)) 224: (ooooo(oo)) 256: (oooooooo) 266: (o(oo)(ooo)) 304: (oooo(ooo)) 343: ((oo)(oo)(oo)) 344: (ooo(o(oo)))
primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]; srQ[n_]:=Or[n==1,With[{m=primeMS[n]},And[Length[m]>1,And@@srQ/@m]]]; Select[Range[1000],PrimeOmega[#]>2&&srQ[#]&]
The initial terms and their corresponding trees: 1: o 4: (oo) 8: (ooo) 16: (oooo) 18: ((oo)o) 25: (o(oo)) 32: (ooooo) 36: ((oo)oo) 50: (o(oo)o) 57: (oo(oo)) 64: (oooooo) 72: ((oo)ooo) 100: (o(oo)oo) 114: (oo(oo)o) 121: (ooo(oo)) 128: (ooooooo) 137: ((oo)(oo)) 144: ((oo)oooo) 200: (o(oo)ooo)
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; srt[n_]:=If[n==1,{},srt/@stc[n-1]]; Select[Range[100],FreeQ[srt[#],[_]?(Length[#]==1&)]&]
G.f. = x + x^2 + 2*x^4 + 2*x^5 + 4*x^6 + 6*x^7 + 12*x^8 + 20*x^9 + ...
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): A059123 := 0,seq(coeff(G059123,x^i),i=1..n); # Ulrich Schimke (ulrschimke(AT)aol.com)
terms = 36; (* F = G001678 *) F[] = 0; Do[F[x] = (x^2/(1 + x))*Exp[Sum[ F[x^k]/(k*x^k), {k, 1, j}]] + O[x]^j // Normal, {j, 1, terms + 1}]; G[x_] = 1 + ((1 + x)/x)*F[x] - (F[x]^2 + F[x^2])/(2*x) + O[x]^terms; CoefficientList[G[x] - 1, x] (* Jean-François Alcover, May 25 2012, updated Jan 12 2018 *)
{a(n) = local(A); if( n<3, n>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( (1 + x) * A - x * (A^2 + subst(A, x, x^2)) / 2, n))}; /* Michael Somos, Jun 13 2014 */
a(5) = 85: ...0................0...............0-o... ...|.............../ \............ /|\.... ...o..............o o...........o o o... ../|\............/ \ ................... .o o o..........o o .................. These trees have 20 + 60 + 5 = 85 labelings. From _Gus Wiseman_, Jan 22 2020: (Start) The a(1) = 1 through a(4) = 16 trees (in the format root[branches]) are: 1 1[2] 1[2,3] 1[2,3,4] 2[1] 2[1,3] 1[2[3,4]] 3[1,2] 1[3[2,4]] 1[4[2,3]] 2[1,3,4] 2[1[3,4]] 2[3[1,4]] 2[4[1,3]] 3[1,2,4] 3[1[2,4]] 3[2[1,4]] 3[4[1,2]] 4[1,2,3] 4[1[2,3]] 4[2[1,3]] 4[3[1,2]] (End)
nn = 20; b = 1 + Sum[nn = n; n! Coefficient[Series[(Exp[x] - x)^n, {x, 0, nn}], x^n]*x^n/n!, {n,1, nn}]; c = Sum[a[n] x^n/n!, {n, 0, nn}]; sol = SolveAlways[b == Series[1/(1 - (c - x)), {x, 0, nn}], x]; Flatten[Table[a[n], {n, 0, nn}] /. sol] nn = 30; CoefficientList[Series[1+x-1/Sum[SeriesCoefficient[(E^x-x)^n,{x,0,n}]*x^n,{n,0,nn}],{x,0,nn}],x] * Range[0,nn]! (* Vaclav Kotesovec, Jan 30 2015 *) sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}]; lrt[set_]:=If[Length[set]==0,{},Join@@Table[Apply[root,#]&/@Join@@Table[Tuples[lrt/@stn],{stn,sps[DeleteCases[set,root]]}],{root,set}]]; Table[Length[Select[lrt[Range[n]],FreeQ[Z@@#,Integer[]]&]],{n,6}] (* Gus Wiseman, Jan 22 2020 *)
Comments