OFFSET
0,9
LINKS
G. C. Greubel, Rows n = 0..20 of the irregular triangle, flattened
Wikipedia, Major index
FORMULA
T(n,k) = A008302(n+1,k) for n + 1 <= k <= n*(n + 1)/2, n > 1. - Franck Maminirina Ramaharo, Oct 14 2018
EXAMPLE
Triangle begins:
1;
1;
1, 0, 1, 1;
1, 0, 2, 3, 5, 3, 1;
1, 0, 3, 5, 11, 22, 20, 15, 9, 4, 1;
1, 0, 4, 7, 18, 41, 90, 101, 101, 90, 71, 49, 29, 14, 5, 1;
...
MATHEMATICA
M[n_]:= CoefficientList[Product[1-x^j, {j, n}]/(1-x)^n, x];
Table[CoefficientList[Sum[M[n+1][[m+1]]*x^m*(1-x)^(n -Min[n, m]), {m, 0, Binomial[n+1, 2]}], x], {n, 0, 10}]//Flatten
PROG
(Maxima)
A008302(n, k) := ratcoef(ratsimp(product((1 - x^j)/(1 - x), j, 1, n)), x, k)$
P(x, n) := sum(A008302(n + 1, j)*x^j*(1 - x)^(n - min(n, j)), j, 0, n*(n + 1)/2)$
create_list(ratcoef(expand(P(x, n)), x, k), n, 0, 10, k, 0, hipow(P(x, n), x)); /* Franck Maminirina Ramaharo, Oct 14 2018 */
(Sage)
@CachedFunction
def A008302(n, k):
if (k<0 or k>binomial(n, 2)): return 0
elif (n==1 and k==0): return 1
def p(n, x): return sum( A008302(n+1, j)*x^j*(1-x)^(n-min(n, j)) for j in (0..binomial(n+1, 2)) )
def T(n): return ( p(n, x) ).full_simplify().coefficients(sparse=False)
flatten([T(n) for n in (0..12)]) # G. C. Greubel, Jul 16 2021
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Roger L. Bagula, Oct 05 2006
EXTENSIONS
Edited, new name, and offset corrected by Franck Maminirina Ramaharo, Oct 14 2018
STATUS
approved