A215861
Number T(n,k) of simple labeled 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, 4, 3, 1, 0, 19, 19, 6, 1, 0, 137, 135, 55, 10, 1, 0, 1356, 1267, 540, 125, 15, 1, 0, 17167, 15029, 6412, 1610, 245, 21, 1, 0, 264664, 218627, 90734, 23597, 3990, 434, 28, 1, 0, 4803129, 3783582, 1515097, 394506, 70707, 8694, 714, 36, 1
Offset: 0
T(4,2) = 19:
.1 2. .1 2. .1-2. .1-2. .1 2. .1 2. .1 2. .1 2. .1 2. .1 2.
. /|. .|\ . .|/ . . \|. . /|. . |. . / . .|\ . . \ . .| .
.4-3. .4-3. .4 3. .4 3. .4 3. .4-3. .4-3. .4 3. .4-3. .4-3.
.
.1-2. .1-2. .1 2. .1-2. .1-2. .1 2. .1-2. .1 2. .1 2.
.| . . / . .|/ . . \ . . |. . \|. . . .| |. . X .
.4 3. .4 3. .4 3. .4 3. .4 3. .4 3. .4-3. .4 3. .4 3.
Triangle T(n,k) begins:
1;
0, 1;
0, 1, 1;
0, 4, 3, 1;
0, 19, 19, 6, 1;
0, 137, 135, 55, 10, 1;
0, 1356, 1267, 540, 125, 15, 1;
0, 17167, 15029, 6412, 1610, 245, 21, 1;
...
Columns k=0-10 give:
A000007,
A215851,
A215852,
A215853,
A215854,
A215855,
A215856,
A215857,
A215858,
A215859,
A215860.
-
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:
seq(seq(T(n, k), k=0..n), n=0..12);
# Alternatively, with the function BellMatrix defined in A264428:
BellMatrix(n -> `if`(n<2, 1, n!/2+(n+1)^(n-1)), 8); # Peter Luschny, Jan 21 2016
-
t[0, 0] = 1; t[n_, k_] /; k < 0 || k > n = 0; t[n_, k_] := t[n, k] =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, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 07 2013 *)
(* Alternatively, with the function BellMatrix defined in A264428: *)
g[n_] = If[n < 2, 1, n!/2 + (n+1)^(n-1)]; BellMatrix[g, 8] (* Peter Luschny, Jan 21 2016 *)
rows = 11;
t = Table[If[n<2, 1, n!/2 + (n+1)^(n-1)], {n, 0, rows}];
T[n_, k_] := BellY[n, k, t];
Table[T[n, k], {n, 0, rows}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 22 2018, after Peter Luschny *)
-
# uses[bell_matrix from A264428]
bell_matrix(lambda n: factorial(n)//2 + (n+1)^(n-1) if n>=2 else 1, 8) # Peter Luschny, Jan 21 2016
A241765
a(n) = n*(n + 1)*(n + 2)*(3*n + 17)/24.
Original entry on oeis.org
0, 5, 23, 65, 145, 280, 490, 798, 1230, 1815, 2585, 3575, 4823, 6370, 8260, 10540, 13260, 16473, 20235, 24605, 29645, 35420, 41998, 49450, 57850, 67275, 77805, 89523, 102515, 116870, 132680, 150040, 169048, 189805, 212415, 236985, 263625, 292448
Offset: 0
a(7) = 4*0 + 5*1 + 6*3 + 7*6 + 8*10 + 9*15 + 10*21 + 11*28 = 798.
-
/* By first comment: */ k:=4; A000217:=func; [&+[(i+k)*A000217(i): i in [0..n]]: n in [0..40]];
-
A241765:=n->n*(n + 1)*(n + 2)*(3*n + 17)/24; seq(A241765(n), n=0..40); # Wesley Ivan Hurt, May 09 2014
-
Table[n (n + 1) (n + 2) (3 n + 17)/24, {n, 0, 40}] (* or *) LinearRecurrence[{5, -10, 10, -5, 1}, {0, 5, 23, 65, 145}, 40]
CoefficientList[Series[x (5 - 2 x)/(1 - x)^5, {x, 0, 40}], x] (* Vincenzo Librandi, May 09 2014 *)
-
makelist(coeff(taylor(x*(5-2*x)/(1-x)^5, x, 0, n), x, n), n, 0, 40);
-
a(n)=n*(n+1)*(n+2)*(3*n+17)/24 \\ Charles R Greathouse IV, Oct 07 2015
-
x='x+O('x^99); concat(0, Vec(x*(5-2*x)/(1-x)^5)) \\ Altug Alkan, Apr 10 2016
-
[n*(n+1)*(n+2)*(3*n+17)/24 for n in (0..40)]
A354794
Triangle read by rows. The Bell transform of the sequence {m^m | m >= 0}.
Original entry on oeis.org
1, 0, 1, 0, 1, 1, 0, 4, 3, 1, 0, 27, 19, 6, 1, 0, 256, 175, 55, 10, 1, 0, 3125, 2101, 660, 125, 15, 1, 0, 46656, 31031, 9751, 1890, 245, 21, 1, 0, 823543, 543607, 170898, 33621, 4550, 434, 28, 1, 0, 16777216, 11012415, 3463615, 688506, 95781, 9702, 714, 36, 1
Offset: 0
Triangle T(n, k) begins:
[0] 1;
[1] 0, 1;
[2] 0, 1, 1;
[3] 0, 4, 3, 1;
[4] 0, 27, 19, 6, 1;
[5] 0, 256, 175, 55, 10, 1;
[6] 0, 3125, 2101, 660, 125, 15, 1;
[7] 0, 46656, 31031, 9751, 1890, 245, 21, 1;
[8] 0, 823543, 543607, 170898, 33621, 4550, 434, 28, 1;
[9] 0, 16777216, 11012415, 3463615, 688506, 95781, 9702, 714, 36, 1;
- Louis Comtet, Advanced Combinatorics. Reidel, Dordrecht, 1974, p. 139-140.
Cf.
A264428,
A039621 (signed variant),
A195979 (row sums),
A000312 (column 1),
A045531 (column 2),
A281596 (column 3),
A281595 (column 4),
A000217 (diagonal 1),
A215862 (diagonal 2),
A354795 (matrix inverse),
A137452 (Abel).
-
T := (n, k) -> if n = k then 1 else
add((-1)^j*(n-j-1)^(n-1)/(j!*(k-1-j)!), j = 0.. k-1) fi:
seq(seq(T(n, k), k = 0..n), n = 0..9);
# Alternatively, using the function BellMatrix from A264428:
BellMatrix(n -> n^n, 9);
# Or by recursion:
R := proc(n, k, m) option remember;
if k < 0 or n < 0 then 0 elif k = 0 then 1 else
m*R(n, k-1, m) + R(n-1, k, m+1) fi end:
A039621 := (n, k) -> ifelse(n = 0, 1, R(k-1, n-k, n-k)):
-
Unprotect[Power]; Power[0, 0] = 1; pow[n_] := n^n;
R = Range[0, 9]; T[n_, k_] := BellY[n, k, pow[R]];
Table[T[n, k], {n, R}, {k, 0, n}] // Flatten
-
from functools import cache
@cache
def t(n, k, m):
if k < 0 or n < 0: return 0
if k == 0: return n ** k
return m * t(n, k - 1, m) + t(n - 1, k, m + 1)
def A354794(n, k): return t(k - 1, n - k, n - k) if n != k else 1
for n in range(9): print([A354794(n, k) for k in range(n + 1)])
A264750
Number of sequences of 5 throws of an n-sided die (with faces numbered 1, 2, ..., n) in which the sum of the throws first reaches or exceeds n on the 5th throw.
Original entry on oeis.org
5, 29, 99, 259, 574, 1134, 2058, 3498, 5643, 8723, 13013, 18837, 26572, 36652, 49572, 65892, 86241, 111321, 141911, 178871, 223146, 275770, 337870, 410670, 495495, 593775, 707049, 836969, 985304, 1153944, 1344904, 1560328, 1802493, 2073813, 2376843, 2714283
Offset: 5
From _Jon E. Schoenfield_, Nov 26 2015: (Start)
For n=5, the a(5) = 5 sequences (i.e., quintuples or 5-tuples) are {1,1,1,1,1}, {1,1,1,1,2}, {1,1,1,1,3}, {1,1,1,1,4} and {1,1,1,1,5}. (Each of the first four throws must be a 1; otherwise, the sum of the throws would reach or exceed 5 before the 5th throw.)
For n=6, each of the quintuples must have four throws whose sum is less than 6, followed by a fifth throw that brings the sum to at least 6, so the a(6) = 29 quintuples are the 5 quintuples {1,1,1,1,t_5} where t_5 is any value in 2..6 and the four sets of 6 quintuples {1,1,1,2,t_5}, {1,1,2,1,t_5}, {1,2,1,1,t_5} and {2,1,1,1,t_5} where t_5 is any value in 1..6. (End)
-
[(n-4)*(n-3)*(n-2)*(n-1)*(4*n+5)/120: n in [5..40]]; // Vincenzo Librandi, Nov 24 2015
-
A264750:=n->(n-4)*(n-3)*(n-2)*(n-1)*(4*n+5)/120: seq(A264750(n), n=5..50); # Wesley Ivan Hurt, Nov 24 2015
-
f[n_, k_] := Module[
{i, total = 0, part, perm},
part = IntegerPartitions[n, {k}];
perm = Flatten[Table[Permutations[part[[i]]], {i, 1, Length[part]}], 1];
For[i = 1, i <= Length[perm], i++, total += n + 1 - perm[[i, k]] ];
Return[total]; ]
And the sequences are obtained by:
h[k_] := Table[f[i, k], {i, k, number_of_terms_wanted}]
Table[(n - 4) (n - 3) (n - 2) (n - 1) (4 n + 5)/120, {n, 5, 40}] (* Bruno Berselli, Nov 24 2015 *)
-
Vec(x^5*(5-x)/(1-x)^6 + O(x^100)) \\ Colin Barker, Nov 23 2015
-
for(n=5, 40, print1((n-4)*(n-3)*(n-2)*(n-1)*(4*n+5)/120", ")); \\ Bruno Berselli, Nov 24 2015
-
[(n-4)*(n-3)*(n-2)*(n-1)*(4*n+5)/120 for n in (5..40)] # Bruno Berselli, Nov 24 2015
Formulae, b-file adapted to the new offset and definition rephrased by the Editors of the OEIS, Nov 26 2015
A269952
Triangle read by rows, T(n,k) = Sum_{j=0..n} (-1)^(n-j)*C(-j,-n)*S2(j,k), S2 the Stirling set numbers A048993, for n>=0 and 0<=k<=n.
Original entry on oeis.org
1, 0, 1, 0, 2, 1, 0, 4, 5, 1, 0, 8, 19, 9, 1, 0, 16, 65, 55, 14, 1, 0, 32, 211, 285, 125, 20, 1, 0, 64, 665, 1351, 910, 245, 27, 1, 0, 128, 2059, 6069, 5901, 2380, 434, 35, 1, 0, 256, 6305, 26335, 35574, 20181, 5418, 714, 44, 1
Offset: 0
1,
0, 1,
0, 2, 1,
0, 4, 5, 1,
0, 8, 19, 9, 1,
0, 16, 65, 55, 14, 1,
0, 32, 211, 285, 125, 20, 1,
0, 64, 665, 1351, 910, 245, 27, 1.
Variant:
A143494 (the main entry for this triangle).
-
A269952 := (n,k) -> Stirling2(n+1, k+1) - Stirling2(n, k+1):
seq(seq(A269952(n,k), k=0..n), n=0..9);
-
Flatten[ Table[ Sum[(-1)^(n-j) Binomial[-j,-n] StirlingS2[j,k], {j,0,n}], {n,0,9}, {k,0,n}]]
A125101
T(n,k) = k*binomial(n-1,k-1) + Fibonacci(k)*binomial(n-1,k) (1 <= k <= n).
Original entry on oeis.org
1, 2, 2, 3, 5, 3, 4, 9, 11, 4, 5, 14, 26, 19, 5, 6, 20, 50, 55, 30, 6, 7, 27, 85, 125, 105, 44, 7, 8, 35, 133, 245, 280, 182, 62, 8, 9, 44, 196, 434, 630, 560, 300, 85, 9, 10, 54, 276, 714, 1260, 1428, 1056, 477, 115, 10, 11, 65, 375, 1110, 2310, 3192, 3030, 1905, 745, 155
Offset: 1
First few rows of the triangle:
1;
2, 2;
3, 5, 3;
4, 9, 11, 4;
5, 14, 26, 19, 5;
6, 20, 50, 55, 30, 6;
7, 27, 85, 125, 105, 44, 7;
8, 35, 133, 245, 280, 182, 62, 8;
...
-
with(combinat): T:=(n,k)->k*binomial(n-1,k-1)+fibonacci(k)*binomial(n-1,k): for n from 1 to 12 do seq(T(n,k),k=1..n) od; # yields sequence in triangular form
-
Flatten[Table[k Binomial[n-1,k-1]+Fibonacci[k]Binomial[n-1,k],{n,15},{k,n}]] (* Harvey P. Dale, Nov 03 2014 *)
A217756
Triangular array read by rows: T(n,k) is the number of simple labeled graphs on n nodes with exactly k components where each component has at most one cycle; n>=1, 1<=k<=n.
Original entry on oeis.org
1, 1, 1, 4, 3, 1, 31, 19, 6, 1, 347, 195, 55, 10, 1, 4956, 2707, 720, 125, 15, 1, 85102, 46319, 12082, 2030, 245, 21, 1, 1698712, 930947, 242774, 40397, 4830, 434, 28, 1, 38562309, 21372678, 5620177, 938826, 112287, 10206, 714, 36, 1
Offset: 1
... o-o ........... o o ........... o o ..........
... ........... | ........... |\ ..........
... o-o ........... o-o ........... o-o ..........
T(4,2) = 19 because the above graphs on 4 nodes have 2 components with at most one cycle. They have respectively 3 + 12 + 4 = 19 labelings.
1;
1, 1;
4, 3, 1;
31, 19, 6, 1;
347, 195, 55, 10, 1;
4956, 2707, 720, 125, 15, 1;
85102, 46319, 12082, 2030, 245, 21, 1;
- V. F. Kolchin, Random Graphs. Encyclopedia of Mathematics and Its Applications 53. Cambridge Univ. Press, Cambridge, 1999, pp 30-31.
-
nn=10;t=Sum[n^(n-1)x^n/n!,{n,1,nn}];f[list_]:=Select[list,#>0&];Map[f,Drop[Range[0,nn]!CoefficientList[Series[Exp[y(t/2-3t^2/4)]/(1-t)^(y/2),{x,0,nn}],{x,y}],1]]//Grid
-
\p 1000 \\ See Peter Luschny formula in A129271.
f(p) = round(((p-1) * exp(p) * incgam(p-1,p) + p^(p-2) * (3-p)) /2);
T(n,k) = { my(S=0, D, p, c); forpart(a = n, D = Set(a);
S += prod(j=1,#D, p=D[j]; c=#select(x-> x==p,Vec(a)); (f(p)/p!)^c /c!)
, [1, n], [k, k]); n! * S }; \\ Washington Bomfim, Jun 16 2020
-
# uses[bell_matrix from A264428]
# Adds a column 1,0,0,0, ... at the left side of the triangle.
bell_matrix(lambda n: A129271(n+1), 10) # Peter Luschny, Jan 18 2016
A264751
Triangle read by rows: T(n,k) is the number of sequences of k <= n throws of an n-sided die (with faces numbered 1, 2, ..., n) in which the sum of the throws first reaches or exceeds n on the k-th throw.
Original entry on oeis.org
1, 1, 2, 1, 5, 3, 1, 9, 11, 4, 1, 14, 26, 19, 5, 1, 20, 50, 55, 29, 6, 1, 27, 85, 125, 99, 41, 7, 1, 35, 133, 245, 259, 161, 55, 8, 1, 44, 196, 434, 574, 476, 244, 71, 9, 1, 54, 276, 714, 1134, 1176, 804, 351, 89, 10, 1, 65, 375, 1110, 2058, 2562, 2190, 1275, 485, 109, 11
Offset: 1
Triangle begins:
1
1 2
1 5 3
1 9 11 4
1 14 26 19 5
1 20 50 55 29 6
1 27 85 125 99 41 7
1 35 133 245 259 161 55 8
1 44 196 434 574 476 244 71 9
1 54 276 714 1134 1176 804 351 89 10
1 65 375 1110 2058 2562 2190 1275 485 109 11
Cf.
A007318 (binomial(n-1,k-1) = number of sequences of k throws of an n-sided die in which the sum of the throws equals n).
-
T[n_, k_] := Module[
{i, total = 0, part, perm},
part = IntegerPartitions[n, {k}];
perm = Flatten[Table[Permutations[part[[i]]], {i, 1, Length[part]}], 1];
For[i = 1, i <= Length[perm], i++, total += n + 1 - perm[[i, k]] ];
Return[total]; ]
(* The rows are obtained by: *)
g[n_] := Table[T[n,k], {k,1,n}]
(* And the triangle is obtained by: *)
Table[g[n],{n,1,number_of_rows_wanted}]
Showing 1-8 of 8 results.
Comments