Help me generalize what this divisor transform does.

66 Views Asked by At

I have an algorithm which takes as input the series expansion of:

$$\frac{-(1 + ax(-2 + x + ax))}{-1 + ax} \tag 1$$

or expressed differently:

$$\left\{a^0,(-a)^1,a^1,a^2,a^3,a^4,a^5,a^6,a^7\right\}$$

and applies the convoluted divisor recurrence via this Mathematica program:

Clear[t, n, k, i, p]
a = 8
coeff = {a^0, -a^1, a^1, a^2, a^3, a^4, a^5, a^6, a^7, a^8, a^9, a^10,
   a^11, a^12, a^13, a^14, a^15, a^16}
CoefficientList[
 Series[-((1 + a*x*(-2 + x + a*x))/(-1 + a*x)), {x, 0, nn - 1}], x]
nn = Length[coeff];
cc = Range[nn]*0 + 1;
Monitor[Do[Clear[t];
  t[n_, 1] := t[n, 1] = cc[[n]];
  t[n_, k_] := 
   t[n, k] = 
    If[n >= k, 
     Sum[t[n - i, k - 1], {i, 1, k - 1}] - 
      Sum[t[n - i, k], {i, 1, k - 1}], 0];
  A4 = Table[Table[t[n, k], {k, 1, nn}], {n, 1, nn}];
  A5 = A4[[1 ;; nn - 1]];
  A5 = Prepend[A5, ConstantArray[0, nn]];
  cc = Total[
    Table[coeff[[n]]*MatrixPower[A5, n - 1][[All, 1]], {n, 1, 
      nn}]];, {i, 1, nn}], i]
cc
CoefficientList[Series[(1 + x)/(1 + (a + 1)*x), {x, 0, nn - 1}], x]

The output is the series expansion of the following expression:

$$\frac{(1 + x)}{1 + (a + 1)x} \tag 2$$

or expressed differently, the row sums of:

$$\begin{array}{l} 1 \\ -a \\ a^2+a \\ -a^3-2 a^2-a \\ a^4+3 a^3+3 a^2+a \\ -a^5-4 a^4-6 a^3-4 a^2-a \\ a^6+5 a^5+10 a^4+10 a^3+5 a^2+a \\ -a^7-6 a^6-15 a^5-20 a^4-15 a^3-6 a^2-a \\ a^8+7 a^7+21 a^6+35 a^5+35 a^4+21 a^3+7 a^2+a \end{array}$$

Can you help me generalize what the expression in (2) is for any expression in $(1)$ ?


Edit 7.12.2014:

The input $1,1,1,1,1,1,1,1,1,1,1,1,1,1,...$

Gives the sequence: $1, 1, 2, 4, 10, 24, 66, 178, 508, 1464,...$

While the input:

$\left\{\frac{1}{x},1,x,x^2,x^3,x^4,x^5,x^6,x^7,x^8\right\}$

gives:

$\left\{\frac{1}{x},\frac{1}{x},\frac{2}{x},\frac{4}{x},\frac{10}{x},\frac{24}{x},\frac{66}{x},\frac{178}{x},\frac{508}{x},\frac{1464}{x}\right\}$

And the input: $\left\{x,1,\frac{1}{x},\frac{1}{x^2},\frac{1}{x^3},\frac{1}{x^4},\frac{1}{x^5},\frac{1}{x^6},\frac{1}{x^7},\frac{1}{x^8}\right\}$

gives:

$\{x,x,2 x,4 x,10 x,24 x,66 x,178 x,508 x,1464 x\}$


Clear[t, n, k, i, p]
coeff = {1, 1, 2, 4, 9, 19, 43, 94, 210, 464, 1035}
nn = Length[coeff];
cc = Range[nn]*0 + 1;
Monitor[Do[Clear[t];
  t[n_, 1] := t[n, 1] = cc[[n]];
  t[n_, k_] := 
   t[n, k] = 
    If[n >= k, 
     Sum[t[n - i, k - 1], {i, 1, k - 1}] - 
      Sum[t[n - i, k], {i, 1, k - 1}], 0];
  A4 = Inverse[Table[Table[t[n, k], {k, 1, nn}], {n, 1, nn}]];
  A5 = A4[[1 ;; nn - 1]];
  A5 = Prepend[A5, ConstantArray[0, nn]];
  cc = Total[
    Table[coeff[[n]]*MatrixPower[A5, n - 1][[All, 1]], {n, 1, 
      nn}]];, {i, 1, nn}], i]
cc

When inverting matrix A4 the output is the all ones sequence (1,1,1,1,1,1,1,1,1,1,...) when using sequence A117160 (1, 1, 2, 4, 9, 19, 43, 94, 210, 464, 1035,...) as input.