login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A299018 Triangle read by rows: T(n,k) is the coefficient of x^k in the polynomial P(n) = n*(x + 1)*P(n - 1) - (n - 2)^2*x*P(n - 2). 0

%I #20 May 24 2020 04:24:32

%S 1,2,2,6,11,6,24,60,60,24,120,366,501,366,120,720,2532,4242,4242,2532,

%T 720,5040,19764,38268,46863,38268,19764,5040,40320,172512,373104,

%U 528336,528336,373104,172512,40320,362880,1668528,3942108,6237828,7213761,6237828,3942108,1668528,362880

%N Triangle read by rows: T(n,k) is the coefficient of x^k in the polynomial P(n) = n*(x + 1)*P(n - 1) - (n - 2)^2*x*P(n - 2).

%F P(0) = 0, P(1) = 1 and P(n) = n * (x + 1) * P(n - 1) - (n - 2)^2 * x * P(n - 2).

%e For n = 3, the polynomial is 6*x^2 + 11*x + 6.

%e The first few polynomials, as a table:

%e [1],

%e [2, 2],

%e [6, 11, 6],

%e [24, 60, 60, 24],

%e [120, 366, 501, 366, 120]

%p P:= proc(n) option remember; expand(`if`(n<2, n,

%p n*(x+1)*P(n-1)-(n-2)^2*x*P(n-2)))

%p end:

%p T:= n-> (p-> seq(coeff(p, x, i), i=0..n-1))(P(n)):

%p seq(T(n), n=1..12); # _Alois P. Heinz_, Jan 31 2018

%p A := proc(n,k) ## n >= 0 and k = 0 .. n

%p option remember;

%p if n = 0 and k = 0 then

%p 1

%p elif n > 0 and k >= 0 and k <= n then

%p (n+1)*(A(n-1,k)+A(n-1,k-1))-(n-1)^2*A(n-2,k-1)

%p else

%p 0

%p end if;

%p end proc: # _Yu-Sheng Chang_, Apr 14 2020

%t P[n_] := P[n] = Expand[If[n < 2, n, n (x+1) P[n-1] - (n-2)^2 x P[n-2]]];

%t row[n_] := CoefficientList[P[n], x];

%t row /@ Range[12] // Flatten (* _Jean-François Alcover_, Dec 10 2019 *)

%o (Sage)

%o @cached_function

%o def poly(n):

%o x = polygen(ZZ, 'x')

%o if n < 1:

%o return x.parent().zero()

%o elif n == 1:

%o return x.parent().one()

%o else:

%o return n * (x + 1) * poly(n - 1) - (n - 2)**2 * x * poly(n - 2)

%Y Very similar to A298854.

%Y Row sums are A277382(n-1) for n>0.

%Y Leftmost and rightmost columns are A000142.

%Y Alternating row sums are A177145.

%Y Alternating row sum of row 2*n+1 is A001818(n).

%K tabl,nonn,easy

%O 1,2

%A _F. Chapoton_, Jan 31 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 16:40 EDT 2024. Contains 371916 sequences. (Running on oeis4.)