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

A000435 Normalized total height of all nodes in all rooted trees with n labeled nodes.

Original entry on oeis.org

0, 1, 8, 78, 944, 13800, 237432, 4708144, 105822432, 2660215680, 73983185000, 2255828154624, 74841555118992, 2684366717713408, 103512489775594200, 4270718991667353600, 187728592242564421568, 8759085548690928992256, 432357188322752488126152, 22510748754252398927872000
Offset: 1

Views

Author

Keywords

Comments

This is the sequence that started it all: the first sequence in the database!
The height h(V) of a node V in a rooted tree is its distance from the root. a(n) = Sum_{all nodes V in all n^(n-1) rooted trees on n nodes} h(V)/n.
In the trees which have [0, n-1] = (0, 1, ..., n-1) as their ordered set of nodes, the number of nodes at distance i from node 0 is f(n,i) = (n-1)...(n-i)(i+1)n^(j-1), 0 <= i < n-1, i+j = n-1 (and f(n,n-1) = (n-1)!): (n-1)...(n-i) counts the words coding the paths of length i from any node to 0, n^(j-1) counts the Pruefer codes of the rest, words build by iterated deletion of the greater node of degree 1 ... except the last one, (i+1), necessary pointing at the path. If g(n,i) = (n-1)...(n-i)n^j, i+j = n-1, f(n,i) = g(n,i) - g(n,i+1), g(n,i) = Sum_{k>=i} f(n,k), the sequence is Sum_{i=1..n-1} g(n,i). - Claude Lenormand (claude.lenormand(AT)free.fr), Jan 26 2001
If one randomly selects one ball from an urn containing n different balls, with replacement, until exactly one ball has been selected twice, the probability that this ball was also the second ball to be selected once is a(n)/n^n. See also A001865. - Matthew Vandermast, Jun 15 2004
a(n) is the number of connected endofunctions with no fixed points. - Geoffrey Critzer, Dec 13 2011
a(n) is the number of weakly connected simple digraphs on n labeled nodes where every node has out-degree 1. A digraph where all out-degrees are 1 can be called a functional digraph due to the correspondence with endofunctions. - Andrew Howroyd, Feb 06 2024

Examples

			For n = 3 there are 3^2 = 9 rooted labeled trees on 3 nodes, namely (with o denoting a node, O the root node):
   o
   |
   o     o   o
   |      \ /
   O       O
The first can be labeled in 6 ways and contains nodes at heights 1 and 2 above the root, so contributes 6*(1+2) = 18 to the total; the second can be labeled in 3 ways and contains 2 nodes at height 1 above the root, so contributes 3*2=6 to the total, giving 24 in all. Dividing by 3 we get a(3) = 24/3 = 8.
For n = 4 there are 4^3 = 64 rooted labeled trees on 4 nodes, namely (with o denoting a node, O the root node):
   o
   |
   o     o        o   o
   |     |         \ /
   o     o   o      o     o o o
   |      \ /       |      \|/
   O       O        O       O
  (1)     (2)      (3)     (4)
Tree (1) can be labeled in 24 ways and contains nodes at heights 1, 2, 3 above the root, so contributes 24*(1+2+3) = 144 to the total;
tree (2) can be labeled in 24 ways and contains nodes at heights 1, 1, 2 above the root, so contributes 24*(1+1+2) = 96 to the total;
tree (3) can be labeled in 12 ways and contains nodes at heights 1, 2, 2 above the root, so contributes 12*(1+2+2) = 60 to the total;
tree (4) can be labeled in 4 ways and contains nodes at heights 1, 1, 1 above the root, so contributes 4*(1+1+1) = 12 to the total;
giving 312 in all. Dividing by 4 we get a(4) = 312/4 = 78.
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A001863, A001864, A001854, A002862 (unlabeled version), A234953, A259334.
Column k=1 of A350452.

Programs

  • Maple
    A000435 := n-> (n-1)!*add (n^k/k!, k=0..n-2);
    seq(simplify((n-1)*GAMMA(n-1,n)*exp(n)),n=1..20); # Vladeta Jovovic, Jul 21 2005
  • Mathematica
    f[n_] := (n - 1)! Sum [n^k/k!, {k, 0, n - 2}]; Array[f, 18] (* Robert G. Wilson v, Aug 10 2010 *)
    nx = 18; Rest[ Range[0, nx]! CoefficientList[ Series[ LambertW[-x] - Log[1 + LambertW[-x]], {x, 0, nx}], x]] (* Robert G. Wilson v, Apr 13 2013 *)
  • PARI
    x='x+O('x^30); concat(0, Vec(serlaplace(lambertw(-x)-log(1+lambertw(-x))))) \\ Altug Alkan, Sep 05 2018
    
  • PARI
    A000435(n)=(n-1)*A001863(n) \\ M. F. Hasler, Dec 10 2018
    
  • Python
    from math import comb
    def A000435(n): return ((sum(comb(n,k)*(n-k)**(n-k)*k**k for k in range(1,(n+1>>1)))<<1) + (0 if n&1 else comb(n,m:=n>>1)*m**n))//n # Chai Wah Wu, Apr 25-26 2023

Formula

a(n) = (n-1)! * Sum_{k=0..n-2} n^k/k!.
a(n) = A001864(n)/n.
E.g.f.: LambertW(-x) - log(1+LambertW(-x)). - Vladeta Jovovic, Apr 10 2001
a(n) = A001865(n) - n^(n-1).
a(n) = A001865(n) - A000169(n). - Geoffrey Critzer, Dec 13 2011
a(n) ~ sqrt(Pi/2)*n^(n-1/2). - Vaclav Kotesovec, Aug 07 2013
a(n)/A001854(n) ~ 1/2 [See Renyi-Szekeres, (4.7)]. Also a(n) = Sum_{k=0..n-1} k*A259334(n,k). - David desJardins, Jan 20 2017
a(n) = (n-1)*A001863(n). - M. F. Hasler, Dec 10 2018

Extensions

Additional references from Valery A. Liskovets
Editorial changes by N. J. A. Sloane, Feb 03 2012
Edited by M. F. Hasler, Dec 10 2018

A001373 Number of functional digraphs (digraphs of functions on n nodes where every node has outdegree 1 and loops of length 1 are forbidden).

Original entry on oeis.org

1, 0, 1, 2, 6, 13, 40, 100, 291, 797, 2273, 6389, 18264, 51916, 148666, 425529, 1221900, 3511507, 10111043, 29142941, 84112009, 243000149, 702758065, 2034150215, 5892907566, 17084615940, 49567063847, 143902155133, 418032946298, 1215076634226, 3533715961160, 10282042126394, 29931877173282, 87173224346464, 253989569994664
Offset: 0

Views

Author

Keywords

References

  • F. Harary and E. M. Palmer, Graphical Enumeration, Academic Press, NY, 1973, p. 70, Table 3.4.1.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Column k=1 of A329228.

Programs

  • Mathematica
    Needs["Combinatorica`];
    nn=30;s[n_,k_]:=s[n,k]=a[n+1-k]+If[n<2 k,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);rt=Table[a[i],{i,1,nn}];c=Drop[Apply[Plus,Table[Take[CoefficientList[CycleIndex[CyclicGroup[n],s]/.Table[s[j]->Table[Sum[rt[[i]] x^(k*i),{i,1,nn}],{k,1,nn}][[j]],{j,1,nn}],x],nn],{n,2,30}]],1];CoefficientList[Series[Product[1/(1-x^i)^c[[i]],{i,1,nn-1}],{x,0,nn}],x]  (* after code given by Robert A. Russell in A000081 *) (* Geoffrey Critzer, Oct 12 2012 *)
  • PARI
    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] ) );
    v0000081=concat([0], A); \\ A000081
    x='x+O('x^N);  T = Ser(v0000081);
    gf = x/T  / prod(n=1,N, 1 - subst(T,'x,'x^n) );
    v001373 = Vec(gf) \\ Joerg Arndt, Apr 17 2014

Formula

Euler transform of A002862.
G.f.: (x/T(x)) / Product_{n>=1} ( 1 - T(x^n) ) where T(x) is the g.f. of A000081, see the Read reference and the PARI code. - Joerg Arndt, Apr 17 2014

Extensions

Sequence extended by Paul Zimmermann
More terms and better description from Christian G. Bower
More terms added by Joerg Arndt, Apr 17 2014

A032177 Number of connected functions of n points with no fixed points and with no symmetries.

Original entry on oeis.org

0, 0, 1, 2, 6, 12, 30, 66, 156, 357, 842, 1961, 4643, 10960, 26072, 62084, 148499, 355784, 855038, 2058536, 4967099, 12005308, 29067646, 70483478, 171158311, 416168250, 1013156687, 2469301316, 6024696764, 14713845227, 35968547836, 88003373522, 215493542625
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

a(n) = A032175(n) - A004111(n). [Corrected by Sean A. Irvine, May 28 2020]

Extensions

More terms from Sean A. Irvine, May 28 2020

A217897 Triangular array read by rows. T(n,k) is the number of unlabeled functions on n nodes that have exactly k fixed points, n >= 0, 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 2, 3, 1, 1, 6, 7, 4, 1, 1, 13, 19, 9, 4, 1, 1, 40, 47, 27, 10, 4, 1, 1, 100, 130, 68, 29, 10, 4, 1, 1, 291, 343, 195, 76, 30, 10, 4, 1, 1, 797, 951, 523, 220, 78, 30, 10, 4, 1, 1, 2273, 2615, 1477, 600, 228, 79, 30, 10, 4, 1, 1, 6389, 7318, 4096, 1708, 625, 230, 79, 30, 10, 4, 1, 1
Offset: 0

Views

Author

Geoffrey Critzer, Oct 14 2012

Keywords

Comments

Row sums are A001372;
Column for k=0 is A001373;
Column for k=1 is A001372. (offset)

Examples

			Triangle begins:
     1;
     0,    1;
     1,    1,    1;
     2,    3,    1,   1;
     6,    7,    4,   1,   1;
    13,   19,    9,   4,   1,  1;
    40,   47,   27,  10,   4,  1,  1;
   100,  130,   68,  29,  10,  4,  1,  1;
   291,  343,  195,  76,  30, 10,  4,  1, 1;
   797,  951,  523, 220,  78, 30, 10,  4, 1, 1;
  2273, 2615, 1477, 600, 228, 79, 30, 10, 4, 1, 1;
		

Programs

  • Mathematica
    Needs["Combinatorica`"]; nn=30;s[n_,k_]:=s[n,k]=a[n+1-k]+If[n<2 k,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);rt=Table[a[i],{i,1,nn}];cfd=Drop[Apply[Plus,Table[Take[CoefficientList[CycleIndex[CyclicGroup[n],s]/.Table[s[j]->Table[Sum[rt[[i]] x^(k*i),{i,1,nn}],{k,1,nn}][[j]],{j,1,nn}],x],nn],{n,2,30}]],1]; CoefficientList[Series[Product[1/(1-x^i)^cfd[[i]]/(1-y x^i)^rt[[i]],{i,1,nn-1}],{x,0,10}],{x,y}]//Grid (* after code given by Robert A. Russell in A000081 *)

Formula

O.g.f.: Product_{n>=1} 1/((1-x^n)^A002862(n) * (1 - y*x^n)^A000081(n) ).
Showing 1-4 of 4 results.