A027852
Number of connected functions on n points with a loop of length 2.
Original entry on oeis.org
0, 1, 1, 3, 6, 16, 37, 96, 239, 622, 1607, 4235, 11185, 29862, 80070, 216176, 586218, 1597578, 4370721, 12003882, 33077327, 91433267, 253454781, 704429853, 1962537755, 5479855546, 15332668869, 42983656210, 120716987723, 339596063606, 956840683968
Offset: 1
Column 2 of
A033185 (forests of rooted trees),
A217781 (unicyclic graphs),
A339303 (unoriented linear forests) and
A339428 (connected functions).
-
with(numtheory): b:= proc(n) option remember; local d, j; `if`(n<=1, n, (add(add(d*b(d), d=divisors(j)) *b(n-j), j=1..n-1))/ (n-1)) end: a:= n-> (add(b(i) *b(n-i), i=0..n) +`if`(irem(n, 2)=0, b(n/2), 0))/2: seq(a(n), n=1..50); # Alois P. Heinz, Aug 22 2008, revised Oct 07 2011
# second, re-usable version
A027852 := proc(N::integer)
local dh, Nprime;
dh := 0 ;
for Nprime from 0 to N do
dh := dh+A000081(Nprime)*A000081(N-Nprime) ;
end do:
if type(N,'even') then
dh := dh+A000081(N/2) ;
end if;
dh/2 ;
end proc: # R. J. Mathar, Mar 06 2017
-
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}]; Take[CoefficientList[CycleIndex[DihedralGroup[2], s] /. Table[s[j] -> Table[Sum[rt[[i]] x^(k*i), {i, 1, nn}], {k, 1, nn}][[j]], {j, 1, nn}], x], {2, nn}] (* Geoffrey Critzer, Oct 12 2012, after code given by Robert A. Russell in A000081 *)
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)];
a[n_] := (Sum[b[i] b[n-i], {i, 0, n}] + If[Mod[n, 2] == 0, b[n/2], 0])/2;
Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Oct 30 2018, after Alois P. Heinz *)
-
seq(max_n)= { my(V = f = vector(max_n), i=1,s); f[1]=1;
for(j=1, max_n - 1, f[j+1] = 1/j * sum(k=1, j, sumdiv(k,d, d * f[d]) * f[j-k+1]));
for(n = 1, max_n, s = sum(k = 1, (n-1)/2, ( f[k] * f[n-k] ));
if(n % 2 == 1, V[i] = s, V[i] = s + (f[n/2]^2 + f[n/2])/2); i++); V };
\\ Washington Bomfim, Jul 06 2012 and Dec 01 2020
A002861
Number of connected functions (or mapping patterns) on n unlabeled points, or number of rings and branches with n edges.
Original entry on oeis.org
1, 2, 4, 9, 20, 51, 125, 329, 862, 2311, 6217, 16949, 46350, 127714, 353272, 981753, 2737539, 7659789, 21492286, 60466130, 170510030, 481867683, 1364424829, 3870373826, 10996890237, 31293083540, 89173833915, 254445242754, 726907585652, 2079012341822
Offset: 1
- S. R. Finch, Mathematical Constants, Cambridge, 2003, Section 5.6.6.
- R. A. Fisher, Contributions to Mathematical Statistics, Wiley, 1950, 41.399.
- 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).
- Alois P. Heinz, Table of n, a(n) for n = 1..1000 (first 500 terms from C. G. Bower)
- A. L. Agore, A. Chirvasitu, and G. Militaru, The set-theoretic Yang-Baxter equation, Kimura semigroups and functional graphs, arXiv:2303.06700 [math.QA], 2023.
- C. G. Bower, Transforms (2)
- Oscar Defrain, Antonio E. Porreca and Ekaterina Timofeeva, Polynomial-delay generation of functional digraphs up to isomorphism, Disc. Appl. Math., vol 357 (2024), pp. 24-33.
- Philippe Flajolet and Robert Sedgewick, Analytic Combinatorics, 2009; see page 480
- R. K. Guy, Letter to N. J. A. Sloane, 1988-04-12 (annotated scanned copy)
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 118
-
spec2861 := [B, {A=Prod(Z,Set(A)), B=Cycle(A)}, unlabeled]; [seq(combstruct[count](spec2861,size=n), n=1..27)];
-
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}]; Apply[Plus, Table[Take[CoefficientList[CycleIndex[CyclicGroup[n], s] /. Table[s[j] -> Table[Sum[rt[[i]] x^(k * i), {i, nn}], {k, 1, nn}][[j]], {j, nn}], x], nn], {n, 30}]] (* Geoffrey Critzer, Oct 12 2012, after code given by Robert A. Russell in A000081 *)
M = 66; A = Table[1, {M + 1}]; For[n = 1, n <= M, n++, A[[n + 1]] = 1/n * Sum[Sum[d * A[[d]], {d, Divisors[k]}] * A[[n - k + 1]], {k, n}]]; A81 = {0} ~ Join ~ A; H[t_] = A81.t^Range[0, Length[A81] - 1]; L = Sum[EulerPhi[j]/j * Log[1/(1 - H[x^j])], {j, M}] + O[x]^M; CoefficientList[L, x] // Rest (* Jean-François Alcover, Dec 28 2019, after Joerg Arndt *)
-
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);
L=sum(j=1,N, eulerphi(j)/j * log(1/(1-H(x^j))));
Vec(L)
\\ Joerg Arndt, Jul 10 2014
A217781
Triangular array read by rows: T(n,k) is the number of n-node connected graphs with exactly one cycle of length k (and no other cycles) for n >= 1 and 1 <= k <= n.
Original entry on oeis.org
1, 1, 1, 2, 1, 1, 4, 3, 1, 1, 9, 6, 3, 1, 1, 20, 16, 7, 4, 1, 1, 48, 37, 18, 9, 4, 1, 1, 115, 96, 44, 28, 10, 5, 1, 1, 286, 239, 117, 71, 32, 13, 5, 1, 1, 719, 622, 299, 202, 89, 45, 14, 6, 1, 1, 1842, 1607, 793, 542, 264, 130, 52, 17, 6, 1, 1
Offset: 1
Triangle begins:
1;
1, 1;
2, 1, 1;
4, 3, 1, 1;
9, 6, 3, 1, 1;
20, 16, 7, 4, 1, 1;
48, 37, 18, 9, 4, 1, 1;
115, 96, 44, 28, 10, 5, 1, 1;
286, 239, 117, 71, 32, 13, 5, 1, 1;
...
-
nn=15;f[list_]:=Select[list,#>0&];t[x_]:=Sum[a[n]x^n,{n,0,nn}];sol=SolveAlways[0==Series[t[x]-x Product[1/(1-x^i)^a[i],{i,1,nn}],{x,0,nn}],x];b=Table[a[n],{n,1,nn}]/.sol//Flatten;Map[f,Drop[Transpose[Table[Take[CoefficientList[CycleIndex[DihedralGroup[n],s]/.Table[s[j]->Table[Sum[b[[i]]x^(i*k),{i,1,nn}],{k,1,nn}][[j]],{j,1,n}],x],nn],{n,1,nn}]],1]]//Grid
-
\\ TreeGf is A000081 as g.f.
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)}
ColSeq(n,k)={my(t=TreeGf(max(0,n+1-k))); my(g(e)=subst(t + O(x*x^(n\e)), x, x^e) + O(x*x^n)); Vec(sumdiv(k, d, eulerphi(d)*g(d)^(k/d))/k + if(k%2, g(1)*g(2)^(k\2), (g(1)^2+g(2))*g(2)^(k/2-1)/2), -n)/2}
M(n, m=n)={Mat(vector(m, k, ColSeq(n,k)~))}
{ my(T=M(12)); for(n=1, #T~, print(T[n,1..n])) } \\ Andrew Howroyd, Dec 03 2020
A339067
Triangle read by rows: T(n,k) is the number of linear forests with n nodes and k rooted trees.
Original entry on oeis.org
1, 1, 1, 2, 2, 1, 4, 5, 3, 1, 9, 12, 9, 4, 1, 20, 30, 25, 14, 5, 1, 48, 74, 69, 44, 20, 6, 1, 115, 188, 186, 133, 70, 27, 7, 1, 286, 478, 503, 388, 230, 104, 35, 8, 1, 719, 1235, 1353, 1116, 721, 369, 147, 44, 9, 1, 1842, 3214, 3651, 3168, 2200, 1236, 560, 200, 54, 10, 1
Offset: 1
Triangle begins:
1;
1, 1;
2, 2, 1;
4, 5, 3, 1;
9, 12, 9, 4, 1;
20, 30, 25, 14, 5, 1;
48, 74, 69, 44, 20, 6, 1;
115, 188, 186, 133, 70, 27, 7, 1;
286, 478, 503, 388, 230, 104, 35, 8, 1;
719, 1235, 1353, 1116, 721, 369, 147, 44, 9, 1;
...
-
b:= proc(n) option remember; `if`(n<2, n, (add(add(d*b(d),
d=numtheory[divisors](j))*b(n-j), j=1..n-1))/(n-1))
end:
T:= proc(n, k) option remember; `if`(k=1, b(n), (t->
add(T(j, t)*T(n-j, k-t), j=1..n-1))(iquo(k, 2)))
end:
seq(seq(T(n, k), k=1..n), n=1..12); # Alois P. Heinz, Dec 04 2020
# Using function PMatrix from A357368. Adds row and column for n, k = 0.
PMatrix(10, A000081); # Peter Luschny, Oct 07 2022
-
b[n_] := b[n] = If[n < 2, n, (Sum[Sum[d*b[d], {d, Divisors[j]}]*b[n - j], {j, 1, n - 1}])/(n - 1)];
T[n_, k_] := T[n, k] = If[k == 1, b[n], With[{t = Quotient[k, 2]}, Sum[T[j, t]*T[n - j, k - t], {j, 1, n - 1}]]];
Table[Table[T[n, k], {k, 1, n}], {n, 1, 12}] // Flatten (* Jean-François Alcover, Jan 03 2021, after Alois P. Heinz *)
-
\\ TreeGf is A000081.
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)}
ColSeq(n,k)={my(t=TreeGf(max(0,n+1-k))); Vec(t^k, -n)}
M(n, m=n)=Mat(vector(m, k, ColSeq(n,k)~))
{ my(T=M(12)); for(n=1, #T~, print(T[n,1..n])) }
A029852
Number of connected functions on n points with a loop of length 3.
Original entry on oeis.org
1, 1, 3, 9, 23, 62, 169, 451, 1217, 3291, 8916, 24243, 66155, 181053, 497134, 1369064, 3780942, 10469573, 29063361, 80867990, 225508124, 630145449, 1764240907, 4948365051, 13902893423, 39124094362, 110265280739, 311208414556, 879523722747, 2488832434859
Offset: 3
-
nn = 20; f[x_] := Sum[a[n] x^n, {n, 0, nn}]; sol =
SolveAlways[
0 == Series[
f[x] - x Product[1/(1 - x^i)^a[i], {i, 1, nn}], {x, 0, nn}],
x]; b = Flatten[Table[a[n], {n, 1, nn}] /. sol]; CoefficientList[
Series[CycleIndex[CyclicGroup[3], s] /.
Table[s[i] -> Sum[b[[k]] x^(k*i), {k, 1, nn}], {i, 1, 3}], {x, 0,
nn}], x] (* Geoffrey Critzer, Aug 08 2013 *)
A029853
Number of connected functions on n points with a loop of length 4.
Original entry on oeis.org
1, 1, 4, 11, 35, 97, 282, 792, 2243, 6275, 17602, 49206, 137713, 385208, 1078667, 3022342, 8478199, 23807190, 66932592, 188394855, 530911452, 1497892857, 4230987944, 11964356354, 33869704270, 95982410945, 272279600817, 773153124315, 2197492308752
Offset: 4
-
nn = 20; f[x_] := Sum[a[n] x^n, {n, 0, nn}]; sol =
SolveAlways[
0 == Series[
f[x] - x Product[1/(1 - x^i)^a[i], {i, 1, nn}], {x, 0, nn}],
x]; b = Flatten[Table[a[n], {n, 1, nn}] /. sol]; CoefficientList[
Series[CycleIndex[CyclicGroup[4], s] /.
Table[s[i] -> Sum[b[[k]] x^(k*i), {k, 1, nn}], {i, 1, 4}], {x, 0,
nn}], x] (* Geoffrey Critzer, Aug 08 2013 *)
A029868
Number of connected functions on n points with a loop of length 5.
Original entry on oeis.org
1, 1, 4, 14, 46, 145, 440, 1315, 3877, 11315, 32792, 94529, 271510, 777764, 2223865, 6350657, 18120730, 51680249, 147359335, 420163711, 1198151432, 3417475326, 9750708533, 27831153091, 79471338455, 227032777454, 648896436944, 1855571389651, 5308837191604
Offset: 5
-
nn = 20; f[x_] := Sum[a[n] x^n, {n, 0, nn}]; sol =
SolveAlways[
0 == Series[
f[x] - x Product[1/(1 - x^i)^a[i], {i, 1, nn}], {x, 0, nn}],
x]; b = Flatten[Table[a[n], {n, 1, nn}] /. sol]; CoefficientList[
Series[CycleIndex[CyclicGroup[5], s] /.
Table[s[i] -> Sum[b[[k]] x^(k*i), {k, 1, nn}], {i, 1, 5}], {x, 0,
nn}], x] (* Geoffrey Critzer, Aug 08 2013 *)
A029869
Number of connected functions on n points with a loop of length 6.
Original entry on oeis.org
1, 1, 5, 18, 63, 206, 671, 2087, 6434, 19472, 58375, 173316, 511452, 1500697, 4386021, 12775455, 37118209, 107621858, 311552351, 900775893, 2601887149, 7510011727, 21664873773, 62473966631, 180104101037, 519126161517, 1496177366884, 4312044894059, 12427896986697
Offset: 6
A029870
Number of connected functions on n points with a loop of length 7.
Original entry on oeis.org
1, 1, 5, 21, 80, 285, 970, 3192, 10236, 32197, 99743, 305276, 925342, 2783012, 8316994, 24726109, 73195582, 215911767, 635028054, 1863156727, 5455350409, 15946267328, 46545783253, 135702643984, 395246786050, 1150250414764, 3345193851398, 9723141517918
Offset: 7
A029871
Number of connected functions on n points with a loop of length 8.
Original entry on oeis.org
1, 1, 6, 25, 104, 384, 1380, 4729, 15806, 51478, 164788, 519296, 1617066, 4983855, 15233671, 46235252, 139506803, 418838281, 1252174861, 3730058316, 11077154790, 32808815240, 96953599162, 285945645659, 841909040785, 2475184643011, 7267678432397, 21315839832323
Offset: 8
Showing 1-10 of 14 results.
Comments