A246212 Duplicate of A163951.
1, 9, 93, 1155, 17025, 292383, 5752131, 127790505, 3167896005, 86756071545, 2602658092419, 84917405260779, 2994675198208785, 113538315994418175
Offset: 2
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.
T(1,1) = |{[0]}|, T(2,1) = |{[0,0],[0,1],[1,1]}|, T(2,2) = |{[0,1]}|. Triangle starts: 1; 1; 3, 1; 16, 9, 2; 125, 93, 32, 6; 1296, 1155, 480, 150, 24, 20; 16807, 17025, 7880, 3240, 864, 840; 262144, 292383, 145320, 71610, 24192, 26250, 720, 0, 0, 504, 0, 420; ...
b:= proc(n, m) option remember; `if`(n=0, x^m, add((j-1)!* b(n-j, ilcm(m, j))*binomial(n-1, j-1), j=1..n)) end: T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(add( b(j, 1)*n^(n-j)*binomial(n-1, j-1), j=0..n)): seq(T(n), n=0..10); # Alois P. Heinz, Aug 14 2017
b[n_, m_]:=b[n, m]=If[n==0, x^m, Sum[(j - 1)!*b[n - j, LCM[m, j]] Binomial[n - 1, j - 1], {j, n}]]; T[n_]:=If[n==0, {1}, Drop[CoefficientList[Sum[b[j, 1]n^(n - j)*Binomial[n - 1, j - 1], {j, 0, n}], x], 1]]; Table[T[n], {n, 0, 10}]//Flatten (* Indranil Ghosh, Aug 17 2017 *)
from sympy.core.cache import cacheit from sympy import binomial, Symbol, lcm, factorial as f, Poly, flatten x=Symbol('x') @cacheit def b(n, m): return x**m if n==0 else sum([f(j - 1)*b(n - j, lcm(m, j))*binomial(n - 1, j - 1) for j in range(1, n + 1)]) def T(n): return Poly(sum([b(j, 1)*n**(n - j)*binomial(n - 1, j - 1) for j in range(n + 1)]),x).all_coeffs()[::-1][1:] print([T(n) for n in range(11)]) # Indranil Ghosh, Aug 17 2017
Triangle T(n,k) begins: 1; 0, 1; 0, 3, 1; 0, 16, 9, 2; 0, 125, 93, 32, 6; 0, 1296, 1155, 500, 150, 24; 0, 16807, 17025, 8600, 3240, 864, 120; 0, 262144, 292383, 165690, 72030, 24696, 5880, 720; ...
with(combinat): b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0, add((i-1)!^j*multinomial(n, n-i*j, i$j)/j!* b(n-i*j, i-1), j=0..n/i))) end: A:= (n, k)-> add(binomial(n-1, j-1)*n^(n-j)*b(j, min(j, k)), j=0..n): T:= (n, k)-> A(n, k) -`if`(k=0, 0, A(n, k-1)): seq(seq(T(n, k), k=0..n), n=0..10);
multinomial[n_, k_List] := n!/Times @@ (k!); b[n_, i_] := b[n, i] = If[n == 0, 1, If[i<1, 0, Sum[(i-1)!^j*multinomial[n, {n-i*j, Sequence @@ Table[i, {j}]}]/j!*b[n-i*j, i-1], {j, 0, n/i}]]]; A[n_, k_] := Sum[Binomial[n-1, j-1]*n^(n-j)*b[j, Min[j, k]], {j, 0, n}]; T[0, 0] = 1; T[n_, k_] := A[n, k] - If[k == 0, 0, A[n, k-1]]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* Jean-François Alcover, Jan 06 2015, after Alois P. Heinz *)
Any period 3 permutation (or disjoint combinations) is one element to be counted. For n=3, where there are only 2 cases: f1:{1,2,3}->{2,3,1} and f2:{1,2,3}->{3,1,2} but for n>3 there are other elements (non-permutations) to be counted (for instance, with n=5, we count with f:{1,2,3,4,5}->{2,4,5,3,4}).
b:= proc(n, m) option remember; `if`(m>3, 0, `if`(n=0, x^m, add( (j-1)!*b(n-j, ilcm(m, j))*binomial(n-1, j-1), j=1..n))) end: a:= n-> coeff(add(b(j, 1)*n^(n-j)*binomial(n-1, j-1), j=0..n), x, 3): seq(a(n), n=0..25); # Alois P. Heinz, Aug 14 2017
b[n_, m_] := b[n, m] = If[m>3, 0, If[n == 0, x^m, Sum[(j - 1)! b[n - j, LCM[m, j]] Binomial[n - 1, j - 1], {j, 1, n}]]]; a[n_] := If[n==0, 0, Coefficient[Sum[b[j, 1] n^(n-j) Binomial[n-1, j-1], {j, 0, n}], x, 3]]; a /@ Range[0, 25] (* Jean-François Alcover, Dec 18 2020, after Alois P. Heinz *)
Comments