A123423 Duplicate of A005195.
1, 2, 3, 6, 10, 20, 37, 76, 153, 329
Offset: 1
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.
a(5) = 7 since the only options are: 3 trees of order 5; 2 forests composed by trees of orders 4 and l; one forest with trees of orders [3 1 1]; and one forest with five isolated nodes.
a(1) = 1 [o]; a(2) = 1 [o-o]; a(3) = 1 [o-o-o]; a(4) = 2 [o-o-o and o-o-o-o] | o G.f. = 1 + x + x^2 + x^3 + 2*x^4 + 3*x^5 + 6*x^6 + 11*x^7 + 23*x^8 + ...
import Data.List (generic_index) import Math.OEIS (getSequenceByID) triangle x = (x * x + x) `div` 2 a000055 n = let {r = genericIndex (fromJust (getSequenceByID "A000081")); (m, nEO) = divMod n 2} in r n - sum (zipWith (*) (map r [0..m]) (map r [n, n-1..])) + (1-nEO) * (triangle (r m + 1)) -- Walt Rorie-Baety, Jun 12 2021
N := 30; P:= PowerSeriesRing(Rationals(),N+1); f := func< A | x*&*[Exp(Evaluate(A,x^k)/k) : k in [1..N]]>; G := x; for i in [1..N] do G := f(G); end for; G000081 := G; G000055 := 1 + G - G^2/2 + Evaluate(G,x^2)/2; A000055 := Eltseq(G000055); // Geoff Baileu (geoff(AT)maths.usyd.edu.au), Nov 30 2009
G000055 := series(1+G000081-G000081^2/2+subs(x=x^2,G000081)/2,x,31); A000055 := n->coeff(G000055,x,n); # where G000081 is g.f. for A000081 starting with n=1 term with(numtheory): b:= proc(n) option remember; `if`(n<=1, n, (add(add(d*b(d), d=divisors(j)) *b(n-j), j=1..n-1))/ (n-1)) end: a:= n-> `if`(n=0, 1, b(n) -(add(b(k) *b(n-k), k=0..n) -`if`(irem(n, 2)=0, b(n/2), 0))/2): seq(a(n), n=0..50); # Alois P. Heinz, Aug 21 2008 # Program to create b-file b000055.txt: A000081 := proc(n) option remember; local d, j; if n <= 1 then n else add(add(d*procname(d),d=numtheory[divisors](j))*procname(n-j),j=1..n-1)/(n-1); fi end: A000055 := proc(nmax) local a81, n, t, a, j, i ; a81 := [seq(A000081(i), i=0..nmax)] ; a := [] ; for n from 0 to nmax do if n = 0 then t := 1+op(n+1, a81) ; else t := op(n+1, a81) ; fi; if type(n, even) then t := t-op(1+n/2, a81)^2/2 ; t := t+op(1+n/2, a81)/2 ; fi; for j from 0 to (n-1)/2 do t := t-op(j+1, a81)*op(n-j+1, a81) ; od: a := [op(a), t] ; od: a end: L := A000055(1000) ; # R. J. Mathar, Mar 06 2009
s[n_, k_] := s[n, k] = a[n + 1 - k] + If[n < 2k, 0, s[n - k, k]]; a[1] = 1; a[n_] := a[n] = Sum[a[i] s[n-1, i] i, {i, 1, n-1}] / (n-1); Table[a[i] - Sum[a[j] a[i-j], {j, 1, i/2}] + If[OddQ[i], 0, a[i/2] (a[i/2] + 1)/2], {i, 1, 50}] (* Robert A. Russell *) b[0] = 0; b[1] = 1; b[n_] := b[n] = Sum[d*b[d]*b[n-j], {j, 1, n-1}, {d, Divisors[j]}]/(n-1); a[0] = 1; a[n_] := b[n] - (Sum[b[k]*b[n-k], {k, 0, n}] - If[Mod[n, 2] == 0, b[n/2], 0])/2; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Apr 09 2014, after Alois P. Heinz *)
{a(n) = local(A, A1, an, i, t); if( n<2, n>=0, an = Vec(A = A1 = 1 + O('x^n)); for(m=2, n, i=m\2; an[m] = sum(k=1, i, an[k] * an[m-k]) + (t = polcoeff( if( m%2, A *= (A1 - 'x^i)^-an[i], A), m-1))); t + if( n%2==0, binomial( -polcoeff(A, i-1), 2)))}; /* Michael Somos */
N=66; A=vector(N+1, j, 1); for (n=1, N, A[n+1] = 1/n * sum(k=1, n, sumdiv(k, d, d * A[d]) * A[n-k+1] ) ); A000081=concat([0], A); H(t)=subst(Ser(A000081, 't), 't, t); x='x+O('x^N); Vec( 1 + H(x) - 1/2*( H(x)^2 - H(x^2) ) ) \\ Joerg Arndt, Jul 10 2014
# uses function from A000081 def A000055(n): return 1 if n == 0 else A000081(n)-sum(A000081(i)*A000081(n-i) for i in range(1,n//2+1)) + (0 if n % 2 else (A000081(n//2)+1)*A000081(n//2)//2) # Chai Wah Wu, Feb 03 2022
[len(list(graphs.trees(n))) for n in range(16)] # Peter Luschny, Mar 01 2020
From _Gus Wiseman_, Apr 29 2024: (Start) Edge-sets of the a(4) = 38 forests: {} {12} {12,13} {12,13,14} {13} {12,14} {12,13,24} {14} {12,23} {12,13,34} {23} {12,24} {12,14,23} {24} {12,34} {12,14,34} {34} {13,14} {12,23,24} {13,23} {12,23,34} {13,24} {12,24,34} {13,34} {13,14,23} {14,23} {13,14,24} {14,24} {13,23,24} {14,34} {13,23,34} {23,24} {13,24,34} {23,34} {14,23,24} {24,34} {14,23,34} {14,24,34} (End)
exp(x+x^2+add(n^(n-2)*x^n/n!, n=3..50)); # second Maple program: a:= proc(n) option remember; `if`(n=0, 1, add( binomial(n-1, j-1)*j^(j-2)*a(n-j), j=1..n)) end: seq(a(n), n=0..20); # Alois P. Heinz, Sep 15 2008 # third Maple program: F:= exp(-LambertW(-x)*(1+LambertW(-x)/2)): S:= series(F,x,51): seq(coeff(S,x,j)*j!, j=0..50); # Robert Israel, May 21 2015
nn=20;t=Sum[n^(n-1)x^n/n!,{n,1,nn}];Range[0,nn]!CoefficientList[ Series[Exp[t-t^2/2],{x,0,nn}],x] (* Geoffrey Critzer, Sep 05 2012 *) nmax = 20; CoefficientList[Series[-LambertW[-x]/(x*E^(LambertW[-x]^2/2)), {x, 0, nmax}], x] * Range[0, nmax]! (* Vaclav Kotesovec, Jul 19 2019 *)
a(n)=if(n<0,0,sum(m=0,n,sum(j=0,m,binomial(m,j)*binomial(n-1,n-m-j)*n^(n-m-j)*(m+j)!/(-2)^j)/m!)) /* Michael Somos, Aug 22 2002 */
Below we show that a(8) = 12073. Note that A140636(n) is the number of connected graphs of positive excess with n nodes. Let G be a disconnected graph of positive excess with 8 nodes. In this case, G has one or two complex components. We have 3 graphs of order 8 with two complex components. One of those graphs is depicted in the figure below: O---O...O---O |\..|...|\./| |.\.|...|.X.| |..\|...|/.\| O---O...O---O If G has one complex component with 5 nodes, the non-complex part of G can be, a) One forest of order 3. There are 3 forests, so A140636(5) * 3 = 39 graphs. b) One triangle, so A140636(5) = 13 graphs. If G has one complex component with 6 nodes, the non-complex part of G is a forest of order 2. There are 2 forests. We have A140636(6) * 2, or 186 graphs. If G has one complex component with 7 nodes, the non-complex part of G is one isolated vertex. We have A140636(7), or 809 graphs. Finally if G is connected, we have A140636(8), or 11005 graphs. The total is 3 + 12 + 2 + 4 + 39 + 13 + 186 + 809 + 11005 = 12073.
brute[m_]:=First[Sort[Table[Sort[Sort /@ (m/.Rule@@@Table[{(Union@@m)[[i]],p[[i]]},{i,Length[p]}])], {p,Permutations[Range[Length[Union@@m]]]}]]]; Table[Length[Union[brute /@ Select[Subsets[Subsets[Range[n],{2}]],Select[Tuples[#], UnsameQ@@#&]=={}&]]],{n,0,5}] (* Gus Wiseman, Feb 14 2024 *)
a(2) = 2 since o o and o-o are the two planar simple graphs on two nodes.
For n=1: o; n=2: o o, o-o; n=3: o o o, o o-o, o-o-o; n=4: o o o o, o o o-o, o-o o-o, o o-o-o, o-o-o-o, K_{2,2}, K_{3,1}. - _Michael Somos_, May 13 2019
From _Gus Wiseman_, Apr 29 2024: (Start) Edge-sets of non-isomorphic representatives of the a(0) = 1 through a(5) = 4 forests: {} . {12} {13,23} {12,34} {12,35,45} {13,24,34} {13,24,35,45} {14,24,34} {14,25,35,45} {15,25,35,45} (End)
brute[m_]:=First[Sort[Table[Sort[Sort/@(m/.Rule@@@Table[{i,p[[i]]},{i,Length[p]}])],{p,Permutations[Union@@m]}]]]; cyc[y_]:=Select[Join@@Table[Select[Join@@Permutations/@Subsets[Union@@y,{k}],And@@Table[MemberQ[Sort/@y,Sort[{#[[i]],#[[If[i==k,1,i+1]]]}]],{i,k}]&],{k,3,Length[y]}],Min@@#==First[#]&]; Table[Length[Union[Union[brute/@Select[Subsets[Subsets[Range[n],{2}]],Union@@#==Range[n]&&Length[cyc[#]]==0&]]]],{n,0,5}] (* Gus Wiseman, Apr 29 2024 *)
EulerT(v)={Vec(exp(x*Ser(dirmul(v,vector(#v,n,1/n))))-1, -#v)} TreeGf(N)={my(A=vector(N, j, 1)); for (n=1, N-1, A[n+1] = 1/n * sum(k=1, n, sumdiv(k, d, d*A[d]) * A[n-k+1] ) ); x*Ser(A)} seq(n)={my(t=TreeGf(n), v=EulerT(Vec(t - t^2/2 + subst(t,x,x^2)/2))); concat([1,0], vector(#v-1, i, v[i+1]-v[i]))} \\ Andrew Howroyd, Aug 01 2024
Comments