Sequence of Differential Equations : Computing coefficients Consider the application $P$ that takes a function $y$ which is $\mathscr{C}^1$ differentiable on $\left]0;+\infty\right[$ so that
$$
P\left(y\right)=xy'-\alpha y
$$
where $\alpha \in \mathbb{R}$.
If we denote $P^{1}=P$ and $P^{n+1}=P^{n} \circ P$ (for $n \geq 1$) then I've shown (if i'm not mistaken) that the equation $P^{n}=0$ is a differential equation of order $n$ on $\left]0;+\infty\right[$ of the form
$$
x^{n}y^{\left(n\right)}\left(x\right)+\sum_{k=0}^{n-1}a_{k,n}x^ky^{\left(k\right)}\left(x\right)=0
$$
For example, $P\circ P=0 \Leftrightarrow x^2y''\left(x\right)+\left(1-2\alpha\right)y'\left(x\right)+\alpha^2y\left(x\right)=0$ which gives
$$
a_{0,1}=-\alpha
$$
and
$$
a_{0,2}=\alpha^2, \ a_{1,2}=1-2\alpha
$$
My goal is to find all the $a_{k,n}$ for $1 \leq k \leq n-1$ and $n \geq 2$.
For the following results, I'm not sure of what i've produced so feel free to correct me :
I've shown that
$$
a_{n,n+1}=\frac{n+1}{2}\left(n-2\alpha\right) \text{ and }a_{0,n}=\left(-\alpha\right)^n
$$
And i've also shown (if I didn't do wrong)
$$
a_{k,n+1}=\left(k-\alpha\right)a_{k,n}+a_{k-1,n}
$$
I was wondering if my results so far were good and if there was a way to compute $a_{k,n}$ for all $k$ and $n$ with the previous recurrence relation
 A: What you have done so far seems correct to me. This is consistent :
If you let $b_{n,j}:= a_{n-j,n} $, then you have shown that (i) $b_{n,n}= (-\alpha)^n $ , (ii)  $b_{n,1}= \frac{n}{2}(n-1-2\alpha) $ and also  (iii) $b_{n+1,j}=(n+1-j-\alpha)b_{n,j-1}+b_{n,j}$. Note that you may also consider that $a_{n,n}=1$ for $n\gt0 $, so that $b_{n,0}=1$.
Clearly for $j \gt n$, you have $b_{n,j}=0$, so that letting $j=n+1$ in (iii), you recover $b_{n,n}=(-\alpha)^n$. For $j=1$ and $n \gt 0$, (iii) is $b_{n+1,1}=(n-\alpha)+b_{n,1}$, and then by telescoping $b_{n+1,1}=\frac{n(n+1)}{2}-\alpha n-\alpha$, that is $$a_{n,n+1}=b_{n+1,1}=\frac{n+1}{2}(n-2\alpha)$$.
By letting $j=2$ in (iii), with this telescoping technique, I also try to derive $a_{n-1,n+1}=b_{n+1,2}$,  for $n \gt 1$:
$$b_{n+1,2}=\frac{n}{2}(n-1-\alpha)(n-1-2\alpha)+b_{n,2} $$
$$b_{n,2}=\frac{n-1}{2}(n-2-\alpha)(n-2-2\alpha)+b_{n-1,2} $$
$$..............$$
$$b_{3,2}=(1-\alpha)(1-2\alpha)+\alpha^2 $$
$$a_{n-1,n+1}=b_{n+1,2}=\sum_{j=2}^n\frac{j}{2}(j-1-\alpha)(j-1-2\alpha)+\alpha^2 $$
$$a_{n-1,n+1}=\frac{1}{2}\sum_{j=2}^nj^3-\frac{2+3\alpha}{2}\sum_{j=2}^nj^2+\frac{(1+\alpha)(1+2\alpha)}{2}\sum_{j=2}^nj+\alpha^2 $$
$$a_{n-1,n+1}=\frac{1}{2}\big(\frac{n^2(n+1)^2}{4}-1\big)-\frac{2+3\alpha}{2}\big(\frac{n(n+1)(2n+1)}{6}-1\big)+\frac{(1+\alpha)(1+2\alpha)}{2}\big(\frac{n(n+1)}{2}-1\big)+\alpha^2 $$
$$a_{n-1,n+1}=\frac{n(n+1)}{4}\Big[\frac{n(n+1)}{2}-\frac{(2+3\alpha)(2n+1)}{3}+(1+\alpha)(1+2\alpha)\Big] $$
The outcome seems very complicated, but I might well have make mistakes.
but when $\alpha=0$, this is $$a_{n-1,n+1}=\frac{n(n+1)}{4}\Big[\frac{n(n+1)}{2}-\frac{2(2n+1)}{3}+1\Big] = {n+1 \brace n-1},$$ a Stirling number of the second kind, as expected for the above recursion...
One might then look for a general expression for $a_{k,n}$ involving Stirling numbers of the second kind.
A: Here is a Mathematica code for computing $a(k,n)=a_{k,n}$ as a polynomial function of $y=\alpha$, for a given $n$. With the results in the case $n=7$.

bb[n_, k_, y_] :=  Module[{x0 = k, n0 = n, y0 = y, f},
f[n0_, 0, y0_] =f[n0, 0, y0] = Which[n0 > 0, 1, n0 == 0, -1, n0 < 0, 0];
f[n0_, x0_, y0_] :=  f[n0, x0, y0] =
Which[n0 > x0, (n0 - x0 - y0) f[n0 - 1, x0 - 1, y0] +
f[n0 - 1, x0, y0] , n0 == x0, (-y0)^x0, n0 < x0, 0];
Factor[Expand[f[n0, x0, y0]]]]
ClearAll[n, k, y]; Do[Do[Print["a(", j,
",", n, ") = ", bb[n, n - j, y]], {j, 0,     n}], {n, 7, 7}]

$a(0,7) = -y^7$
$a(1,7) = 1-7 y+21 y^2-35 y^3+35 y^4-21 y^5+7 y^6$
$a(2,7) = -7 (-1+y) (9-22 y+23 y^2-12 y^3+3 y^4)$
$a(3,7) = 7 (43-90 y+75 y^2-30 y^3+5 y^4)$
$ a(4,7) = -35 (-2+y) (5-4 y+y^2)$
$a(5,7) = 7 (20-15 y+3 y^2)$
$a(6,7) = -7 (-3+y)$
$a(7,7) = 1$
A: Here is another code for the computation of $a_{n-k,n}$, for a given $k$, as a polynomial function of $n$ and $\alpha$, but the binomial coefficient ${n\choose i}$ is involved instead of the monomial $n^i$.

pp[j_,h_,$\alpha$_]:=Module[{j0=j, h0=h,$\alpha$0=$\alpha$, f},
f[0,h0_,$\alpha$0_]:=f[0,h0,$\alpha$0]=0;
f[j0_,h0_,$\alpha$0_]:=
f[j0,h0,$\alpha$0]=If[2j0>h0>j0-1,(h0-1)f[j0-1,h0-2,$\alpha$0]+(h0-j0-$\alpha$0)f[j0-1,h0-1,$\alpha$0]
$-\alpha$0*Sum[StirlingS2[i,i-j0+1]Binomial[h0-1,i](-1)^(h0-1-i),{i,j0-1,h0-1}],0];
Expand[f[j0,h0,$\alpha$0],$\alpha$0]]
Do[
Do[S[h]=pp[J,h,$\alpha$]+Sum[StirlingS2[i,i-J]*((-1)^(h-i))*Binomial[h,i],{i,J,h}],{h,J,2J}];
h=J;B=0;
While[h$\le$2J,B=Expand[B+S[h]Subsuperscript[C,n,h],C];h=h+1];
Print[Subscript[a,n-J ","n],"=",B],{J,1,4}]

The outcome for $1\le k \le 4$ is:
$$a_{n-1,n}=-\alpha{n\choose1}+{n\choose2}$$
$$a_{n-2,n}=\alpha^2{n\choose2}+(1-3\alpha){n\choose3}+3{n\choose4}$$
$$a_{n-3,n}=-\alpha^3{n\choose3}+(1-4\alpha+6\alpha^2){n\choose4}+(10-15\alpha){n\choose5}+15{n\choose6}$$
$$a_{n-4,n}=\alpha^4{n\choose4}+(1-5\alpha+10\alpha^2-10\alpha^3){n\choose5}+(25-60\alpha+45\alpha^2){n\choose6}+(105-105\alpha){n\choose7}+105{n\choose8}$$
A: And finally, a more general expression for $a_{k,n}$ is $$ a_{k,n} = \frac{(-1)^k}{k!}\sum_{j=0}^k(-1)^j{k\choose j}(j-\alpha)^n$$  which is similar to the well-known
$$ {n\brace k} = \frac{(-1)^k}{k!}\sum_{j=0}^k(-1)^j{k\choose j}j^n$$ so that the $a_{k,n}$ are indeed some sort of generalized Stirling number of the second kind.
Then, the initial linear differential equation of order $n$ reads
$$  \sum_{j,k\le n}\frac{(-1)^{k-j}}{k!}{k\choose j}(j-\alpha)^nx^ky^{(k)}(x)=0.$$
