login
Apply the triangle-to-triangle transformation described in the Comments in A159041 to the triangle in A142459.
3

%I #11 Mar 20 2022 02:17:09

%S 1,1,1,1,-58,1,1,-307,-307,1,1,-1556,12006,-1556,1,1,-7805,140722,

%T 140722,-7805,1,1,-39054,1461615,-5647300,1461615,-39054,1,1,-195303,

%U 14287093,-109642851,-109642851,14287093,-195303,1,1,-976552,135028828,-1838120344,4873361350,-1838120344,135028828,-976552,1

%N Apply the triangle-to-triangle transformation described in the Comments in A159041 to the triangle in A142459.

%H G. C. Greubel, <a href="/A225434/b225434.txt">Rows n = 0..50 of the triangle, flattened</a>

%F A triangle of polynomial coefficients: p(x,n) = Sum_{i=0..n} ( x^i * if(i = floor(n/2) and (n mod 2) = 0, 0, if(i <= floor(n/2), (-1)^i*A142459(n+1, i+1), (-1)^(n-i+1)*A142459(n+1, i+1) ) )/(1-x).

%F T(n, k) = T(n,k-1) + (-1)^k*A142459(n+2,k+1) if k <= floor(n/2), otherwise T(n, n-k), with T(n, 0) = T(n, n) = 1. - _G. C. Greubel_, Mar 19 2022

%e The triangle begins:

%e 1;

%e 1, 1;

%e 1, -58, 1;

%e 1, -307, -307, 1;

%e 1, -1556, 12006, -1556, 1;

%e 1, -7805, 140722, 140722, -7805, 1;

%e 1, -39054, 1461615, -5647300, 1461615, -39054, 1;

%e 1, -195303, 14287093, -109642851, -109642851, 14287093, -195303, 1;

%p See A159041.

%t (* First program *)

%t t[n_, k_, m_]:= t[n, k, m]= If[k==0 || k==n, 1, (m*(n+1)-m*(k+1)+1)*t[n-1,k-1,m] + (m*(k+1)-(m-1))*t[n-1,k,m] ]; (* t(n,k,4)=A142459 *)

%t p[x_, n_]:= p[x, n]= Sum[x^i*If[i==Floor[n/2] && Mod[n, 2]==0, 0, If[i<=Floor[n/2], (-1)^i*t[n,i,4], (-1)^(n-i+1)*t[n,i,4]]], {i,0,n}]/(1-x);

%t Flatten[Table[CoefficientList[p[x, n], x], {n,0,12}]]

%t (* Second program *)

%t t[n_, k_, m_]:= t[n, k, m]= If[k==1 || k==n, 1, (m*(n+1)-m*(k+1)+1)*t[n-1,k-1,m] + (m*(k+1)-(m-1))*t[n-1,k,m]];

%t T[n_, k_]:= T[n, k]= If[k==0 || k==n, 1, If[k<=Floor[n/2], T[n, k-1] + (-1)^k*t[n+2,k+1,4], T[n, n-k]]];

%t Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* _G. C. Greubel_, Mar 19 2022 *)

%o (Sage)

%o @CachedFunction

%o def T(n, k, m):

%o if (k==1 or k==n): return 1

%o else: return (m*(n-k)+1)*T(n-1, k-1, m) + (m*k-m+1)*T(n-1, k, m)

%o def A142459(n,k): return T(n,k,4)

%o @CachedFunction

%o def A225434(n,k):

%o if (k==0 or k==n): return 1

%o elif (k <= (n//2)): return A225434(n,k-1) + (-1)^k*A142459(n+2,k+1)

%o else: return A225434(n,n-k)

%o flatten([[A225434(n,k) for k in (0..n)] for n in (0..12)]) # _G. C. Greubel_, Mar 19 2022

%Y Cf. A142459, A159041.

%K sign,tabl

%O 0,5

%A _Roger L. Bagula_, May 07 2013

%E Edited by _N. J. A. Sloane_, May 11 2013