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-10 of 17 results. Next

A144164 Number of simple graphs on n labeled nodes, where each maximally connected subgraph is either a tree or a cycle, also row sums of A144163, A215861.

Original entry on oeis.org

1, 1, 2, 8, 45, 338, 3304, 40485, 602075, 10576466, 214622874, 4941785261, 127282939615, 3625467047196, 113140481638088, 3838679644895477, 140681280613912089, 5538276165405744140, 233086092164091031114, 10443453353262112373541, 496313160155209940833001
Offset: 0

Views

Author

Alois P. Heinz, Sep 12 2008

Keywords

Examples

			a(3) = 8, because there are 8 simple graphs on 3 labeled nodes, where each maximally connected subgraph is either a tree or a cycle, with edge-counts 0(1), 1(3), 2(3), 3(1):
.1.2. .1-2. .1.2. .1.2. .1-2. .1.2. .1-2. .1-2.
..... ..... ../.. .|... ../.. .|/.. .|... .|/..
.3... .3... .3... .3... .3... .3... .3... .3...
		

Crossrefs

Row sums of triangles A144163, A215861.
The unlabeled version is A215978.

Programs

  • Maple
    f:= proc(n,k) option remember; local j; if k=0 then 1 elif k<0 or n<=k then 0 elif k=n-1 then n^(n-2) else add(binomial(n-1,j) *f(j+1,j) *f(n-1-j,k-j), j=0..k) fi end:
    c:= proc(n,k) option remember; local i,j; if k=0 then 1 elif k<0 or n add(T(n,k), k=0..n):
    seq(a(n), n=0..25);
  • Mathematica
    f[n_, k_] := f[n, k] = Module[{j}, Which[k == 0, 1, k<0 || n <= k, 0, k == n-1, n^(n-2), True, Sum[Binomial[n-1, j]*f[j+1, j]*f[n-1-j, k-j], {j, 0, k}]]]; c[n_, k_] := c[n, k] = Module[{i, j}, If[k == 0, 1, If[k<0 || nJean-François Alcover, Mar 05 2014, after Alois P. Heinz *)
  • Python
    from sympy.core.cache import cacheit
    from sympy import binomial, prod
    @cacheit
    def f(n, k): return 1 if k==0 else 0 if k<0 or n<=k else n**(n - 2) if k == n - 1 else sum(binomial(n - 1, j)*f(j + 1, j)*f(n - 1 - j, k - j) for j in range(k + 1))
    @cacheit
    def c(n, k): return 1 if k==0 else 0 if k<0 or nIndranil Ghosh, Aug 07 2017

Formula

a(n) = Sum_{k=0..n} A144163(n,k).
a(n) ~ c * n^(n-2), where c = 1.66789780037... . - Vaclav Kotesovec, Sep 08 2014

A215977 Number T(n,k) of simple unlabeled graphs on n nodes with exactly k connected components that are trees or cycles; triangle T(n,k), n >= 0, 0 <= k <= n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 2, 1, 1, 0, 3, 3, 1, 1, 0, 4, 5, 3, 1, 1, 0, 7, 10, 6, 3, 1, 1, 0, 12, 17, 12, 6, 3, 1, 1, 0, 24, 33, 23, 13, 6, 3, 1, 1, 0, 48, 62, 47, 25, 13, 6, 3, 1, 1, 0, 107, 127, 92, 53, 26, 13, 6, 3, 1, 1, 0, 236, 267, 189, 106, 55, 26, 13, 6, 3, 1, 1
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2012

Keywords

Examples

			T(4,1) = 3: .o-o.  .o-o.  .o-o.
            .| |.  .|  .  .|\ .
            .o-o.  .o-o.  .o o.
.
T(4,2) = 3: .o-o.  .o-o.  .o-o.
            .|/ .  .|  .  .   .
            .o o.  .o o.  .o-o.
.
T(5,1) = 4: .o-o-o.  .o-o-o.  .o-o-o.  .o-o-o.
            .|  / .  .|    .  .| |  .  . /|  .
            .o-o  .  .o-o  .  .o o  .  .o o  .
.
T(5,2) = 5: .o-o o.  .o-o o.  .o-o o.  .o o-o.  .o o-o.
            .| |  .  .|    .  .|\   .  .|\   .  .|    .
            .o-o  .  .o-o  .  .o o  .  .o-o  .  .o-o  .
Triangle T(n,k) begins:
  1;
  0,  1;
  0,  1,  1;
  0,  2,  1,  1;
  0,  3,  3,  1,  1;
  0,  4,  5,  3,  1,  1;
  0,  7, 10,  6,  3,  1,  1;
  0, 12, 17, 12,  6,  3,  1,  1;
  ...
		

Crossrefs

Row sums give: A215978.
Limiting sequence of reversed rows gives: A215979.
The labeled version of this triangle is A215861.

Programs

  • Mathematica
    b[n_] := b[n] = If[n <= 1, n, Sum[Sum[d*b[d], {d, Divisors[j]}]*b[n-j], {j, 1, n-1}]/(n-1)];
    g[n_] := g[n] = If[n>2, 1, 0]+b[n]-(Sum [b[k]*b[n-k], {k, 0, n}] - If[Mod[n, 2] == 0, b[n/2], 0])/2;
    p[n_, i_, t_] := p[n, i, t] = If[nJean-François Alcover, Dec 04 2014, after Alois P. Heinz *)
  • Python
    from sympy.core.cache import cacheit
    from sympy import binomial, divisors
    @cacheit
    def b(n): return n if n<2 else sum([sum([d*b(d) for d in divisors(j)])*b(n - j) for j in range(1, n)])//(n - 1)
    @cacheit
    def g(n): return (1 if n>2 else 0) + b(n) - (sum(b(k)*b(n - k) for k in range(n + 1)) - (b(n//2) if n%2==0 else 0))//2
    @cacheit
    def p(n, i, t): return 0 if nIndranil Ghosh, Aug 07 2017

A215862 Number of simple labeled graphs on n+2 nodes with exactly n connected components that are trees or cycles.

Original entry on oeis.org

0, 4, 19, 55, 125, 245, 434, 714, 1110, 1650, 2365, 3289, 4459, 5915, 7700, 9860, 12444, 15504, 19095, 23275, 28105, 33649, 39974, 47150, 55250, 64350, 74529, 85869, 98455, 112375, 127720, 144584, 163064, 183260, 205275, 229215, 255189, 283309, 313690, 346450
Offset: 0

Views

Author

Alois P. Heinz, Aug 25 2012

Keywords

Comments

Partial sums of A077414. - Bruno Berselli, Jul 30 2015

Examples

			a(1) = 4:
.1-2.  .1-2.  .1-2.  .1 2.
.|/ .  .|. .  . / .  .|/ .
.3...  .3...  .3...  .3...
		

Crossrefs

A diagonal of A215861.
Regarding the sixth formula, see similar sequences listed in A241765.

Programs

  • Maple
    a:= n-> binomial(n+2,3)*(3*n+13)/4:
    seq(a(n), n=0..40);
  • Mathematica
    Table[Binomial[n+2,3] (3n+13)/4,{n,0,40}] (* or *) LinearRecurrence[ {5,-10,10,-5,1},{0,4,19,55,125},40] (* Harvey P. Dale, Sep 10 2012 *)

Formula

G.f.: (x-4)*x/(x-1)^5.
a(n) = C(n+2,3)*(3*n+13)/4.
a(n) = 5*a(n-1)- 10*a(n-2)+ 10*a(n-3) -5*a(n-4)+a(n-5), n>4. - Harvey P. Dale, Sep 10 2012
a(n) = (1/n!) * Sum_{j=0..n} C(n,j)*(-1)^(n-j)*j^(n+1)*(j-1). - Vladimir Kruchinin, Jun 06 2013
a(n) = 4*A000332(n+2) - A000332(n+1). - R. J. Mathar, Aug 12 2013
a(n) = Sum_{i=0..n} (3+i)*A000217(i). - Bruno Berselli, Apr 29 2014

A215851 Number of simple labeled graphs on n nodes with exactly 1 connected component that is a tree or a cycle.

Original entry on oeis.org

1, 1, 4, 19, 137, 1356, 17167, 264664, 4803129, 100181440, 2359762091, 61937322624, 1792399894837, 56697025885696, 1946238657504975, 72058247875111936, 2862433512904759793, 121439708940308299776, 5480390058971655049939, 262144060822550204416000
Offset: 1

Views

Author

Alois P. Heinz, Aug 25 2012

Keywords

Examples

			a(3) = 4:
.1-2.  .1-2.  .1-2.  .1 2.
.|/ .  .|  .  . / .  .|/ .
.3...  .3...  .3...  .3...
		

Crossrefs

Column k=1 of A215861.
The unlabeled version is A215981.

Programs

  • Maple
    a:= n-> `if`(n<3, 1, (n-1)!/2+n^(n-2)):
    seq(a(n), n=1..25);

Formula

a(1) = a(2) = 1, a(n) = A000272(n) + A001710(n-1) = n^(n-2) + (n-1)!/2 for n>2.

A215852 Number of simple labeled graphs on n nodes with exactly 2 connected components that are trees or cycles.

Original entry on oeis.org

1, 3, 19, 135, 1267, 15029, 218627, 3783582, 75956664, 1734309929, 44357222772, 1255715827483, 38971877812380, 1315634598619830, 47994245894462576, 1881406032047006812, 78870928008704884848, 3520953336130828001295, 166762291211479030734580
Offset: 2

Views

Author

Alois P. Heinz, Aug 25 2012

Keywords

Examples

			a(3) = 3:
.1 2.  .1-2.  .1 2.
.|. .  . . .  . / .
.3...  .3...  .3...
		

Crossrefs

Column k=2 of A215861.
The unlabeled version is A215982.

Programs

  • Maple
    T:= proc(n, k) option remember; `if`(k<0 or k>n, 0,
          `if`(n=0, 1, add(binomial(n-1, i)*T(n-1-i, k-1)*
          `if`(i<2, 1, i!/2 +(i+1)^(i-1)), i=0..n-k)))
        end:
    a:= n-> T(n, 2):
    seq(a(n), n=2..25);
  • Mathematica
    T[n_, k_]:=T[n, k]=If[k<0 || k>n, 0, If[n==0, 1, Sum[Binomial[n - 1, i] T[n - 1 - i, k - 1] If[i<2, 1, i!/2 + (i + 1)^(i - 1)], {i, 0, n - k}]]]; Table[T[n, 2], {n, 2, 50}] (* Indranil Ghosh, Aug 07 2017, after Maple *)
  • Python
    from sympy.core.cache import cacheit
    from sympy import binomial, factorial as f
    @cacheit
    def T(n, k): return 0 if k<0 or k>n else 1 if n==0 else sum([binomial(n - 1, i)*T(n - 1 - i, k - 1)*(1 if i<2 else f(i)//2 + (i + 1)**(i - 1)) for i in range(n - k + 1)])
    def a(n): return T(n , 2)
    print([a(n) for n in range(2, 51)]) # Indranil Ghosh, Aug 07 2017, after maple code

Formula

a(n) ~ c * n^(n-2), where c = 0.511564031298... . - Vaclav Kotesovec, Sep 07 2014

A215853 Number of simple labeled graphs on n nodes with exactly 3 connected components that are trees or cycles.

Original entry on oeis.org

1, 6, 55, 540, 6412, 90734, 1515097, 29368155, 649910349, 16178495157, 447436384356, 13607804913248, 451277483034618, 16204761730619392, 626327433705523558, 25924177756443661632, 1144012780063556028591, 53615833082093775740400, 2659498185704802765924159
Offset: 3

Views

Author

Alois P. Heinz, Aug 25 2012

Keywords

Examples

			a(4) = 6:
.1-2.  .1 2.  .1 2.  .1 2.  .1 2.  .1 2.
.   .  .  |.  .   .  .|  .  . \ .  . / .
.4 3.  .4 3.  .4-3.  .4 3.  .4 3.  .4 3.
		

Crossrefs

Column k=3 of A215861.
The unlabeled version is A215983.

Programs

  • Maple
    T:= proc(n, k) option remember; `if`(k<0 or k>n, 0,
          `if`(n=0, 1, add(binomial(n-1, i)*T(n-1-i, k-1)*
          `if`(i<2, 1, i!/2 +(i+1)^(i-1)), i=0..n-k)))
        end:
    a:= n-> T(n, 3):
    seq(a(n), n=3..25);
  • Mathematica
    T[n_, k_] := T[n, k] = If[k<0 || k>n, 0, If[n == 0, 1, Sum[Binomial[n-1, i]*T[n-1-i, k-1]*If[i<2, 1, i!/2 + (i+1)^(i-1)], {i, 0, n-k}]]];
    a[n_] := T[n, 3];
    Table[a[n], {n, 3, 25}] (* Jean-François Alcover, Apr 01 2017, translated from Maple *)

Formula

a(n) ~ c * n^(n-2), where c = 0.130848879059... . - Vaclav Kotesovec, Sep 07 2014

A215854 Number of simple labeled graphs on n nodes with exactly 4 connected components that are trees or cycles.

Original entry on oeis.org

1, 10, 125, 1610, 23597, 394506, 7533445, 163190665, 3971678359, 107502644249, 3205669601953, 104435680520535, 3690517248021753, 140590728463023632, 5743180320999041664, 250423270549658253350, 11608409727652016747176, 570034426072900362961212
Offset: 4

Views

Author

Alois P. Heinz, Aug 25 2012

Keywords

Examples

			a(4) = 1: the graph with 4 1-node trees.
a(5) = 10: each graph has one 2-node tree and 3 1-node trees, and C(5,2) = 10.
		

Crossrefs

Column k=4 of A215861.
The unlabeled version is A215984.

Programs

  • Maple
    T:= proc(n, k) option remember; `if`(k<0 or k>n, 0,
          `if`(n=0, 1, add(binomial(n-1, i)*T(n-1-i, k-1)*
          `if`(i<2, 1, i!/2 +(i+1)^(i-1)), i=0..n-k)))
        end:
    a:= n-> T(n, 4):
    seq(a(n), n=4..25);

A215855 Number of simple labeled graphs on n nodes with exactly 5 connected components that are trees or cycles.

Original entry on oeis.org

1, 15, 245, 3990, 70707, 1381695, 30015205, 724574235, 19353600409, 568456078190, 18238727824135, 635132015698180, 23864603640853943, 962474842863397305, 41472195692307932196, 1901422216588179732355, 92422276780875117660486, 4747285506511684927770980
Offset: 5

Views

Author

Alois P. Heinz, Aug 25 2012

Keywords

Examples

			a(6) = 15: each graph has one 2-node tree and 4 1-node trees, and C(6,2) = 15.
		

Crossrefs

Column k=5 of A215861.
The unlabeled version is A215985.

Programs

  • Maple
    T:= proc(n, k) option remember; `if`(k<0 or k>n, 0,
          `if`(n=0, 1, add(binomial(n-1, i)*T(n-1-i, k-1)*
          `if`(i<2, 1, i!/2 +(i+1)^(i-1)), i=0..n-k)))
        end:
    a:= n-> T(n, 5):
    seq(a(n), n=5..25);

A215856 Number of simple labeled graphs on n nodes with exactly 6 connected components that are trees or cycles.

Original entry on oeis.org

1, 21, 434, 8694, 183099, 4138827, 101682724, 2726328033, 79746709042, 2537322057270, 87447979819018, 3249640607490732, 129613729260208069, 5525005710150786189, 250709547490889697735, 12067446246711780717009, 614138343777115783675203
Offset: 6

Views

Author

Alois P. Heinz, Aug 26 2012

Keywords

Examples

			a(7) = 21: each graph has one 2-node tree and 5 1-node trees and C(7,2) = 21.
		

Crossrefs

Column k=6 of A215861.
The unlabeled version is A215986.

Programs

  • Maple
    T:= proc(n, k) option remember; `if`(k<0 or k>n, 0,
          `if`(n=0, 1, add(binomial(n-1, i)*T(n-1-i, k-1)*
          `if`(i<2, 1, i!/2 +(i+1)^(i-1)), i=0..n-k)))
        end:
    a:= n-> T(n, 6):
    seq(a(n), n=6..25);

A215857 Number of simple labeled graphs on n nodes with exactly 7 connected components that are trees or cycles.

Original entry on oeis.org

1, 28, 714, 17220, 424809, 11002068, 303874714, 9016296289, 288135739892, 9913826194272, 366486926833846, 14513217676764534, 613646633464214863, 27609928896732666760, 1317652578222779606269, 66497975770225498765728, 3538905411811229060814213
Offset: 7

Views

Author

Alois P. Heinz, Aug 26 2012

Keywords

Examples

			a(8) = 28: each graph has one 2-node tree and 6 1-node trees and C(8,2) = 28.
		

Crossrefs

Column k=7 of A215861.
The unlabeled version is A215987.

Programs

  • Maple
    T:= proc(n, k) option remember; `if`(k<0 or k>n, 0,
          `if`(n=0, 1, add(binomial(n-1, i)*T(n-1-i, k-1)*
          `if`(i<2, 1, i!/2 +(i+1)^(i-1)), i=0..n-k)))
        end:
    a:= n-> T(n, 7):
    seq(a(n), n=7..25);
Showing 1-10 of 17 results. Next