Check on Theorem 27.7 of page 313  (Memoir-Mar-05)   for n = 4

The version number of Mathematica used to evaluate this notebook:

$VersionNumber

p  =  10;    Date[]

TrueQ[ $VersionNumber >= 3.0]

$VersionNumber

a[2][z_]=b[2][z]-D[b[1][z], z]/2-(b[1][z])^2/4

w[0, 0, 0, 0][z_]=1;

w[0, 0, 0, 1][z_]=Binomial[m, 2]*b[1][z];

w[0, 0, 0, 2][z_]=( Binomial[m + 1, 3]*a[2][z]+((m - 1)/2)*D[w[0, 0, 0, 1][z], z]+((m - 1)/(2  m))*(w[0, 0, 0, 1][z])^2 );

w[i2_, i1_, i3_, i4_] := w[i1, i2, i3, i4] /; i2 > i1

w[i1_, i3_, i2_, i4_] := w[i1, i2, i3, i4] /; i3 > i2

w[i1_, i2_, i4_, i3_] := w[i1, i2, i3, i4] /;  i4 > i3

w[2, 6, 1, 7][z]

Do[SumOfPowers[n,j_]=Sum[k^n,{k, j + 1, m}],{n,  0,  2*p + 1}]

K[-1,j_]=0;

K[0,j_]=1;

summandK[i_,j_]:=Expand[
            D[K[i, j], z] - ((m - 1)*b[1][z]*K[i, j])/
                2 + (m - i - j + 1)*(1 - i - j)*a[2][z]*
                K[i - 1, j]]

Do[ K[i,j_]=Module[{t, k},t = Expand[summandK[i - 1, k]];Sum[Coefficient[t, k, n]*SumOfPowers[n, j],{n, 0, 2*i - 1}]],{i, 1, p}]

L[i1_,i2_,i3_,i4_]:=Sum[ K[i1 - r1, r1]*K[i2 - r2, r2]*K[i3 - r3, r3]*
                K[i4 - r4, r4]*w[r1, r2, r3, r4][z],{r1,0,i1},{r2,0,i2},{r3, 0, i3},{r4, 0, i4}]

H[l1_, l2_, l3_, l4_, h1_, h2_, h3_, h4_] := 
      Binomial[m - h1, l1 - h1]*Product[(l1 - r), {r, 1, l1 - h1}]*
        Binomial[m - h2, l2 - h2]*Product[(l2 - r), {r, 1, l2 - h2}]*
        Binomial[m - h3, l3 - h3]*Product[(l3 - r), {r, 1, l3 - h3}]*
        Binomial[m - h4, l4 - h4]*
        Product[(l4 - r), {r, 1, l4 - h4}]

M[l1_,l2_,l3_,l4_,h1_,h2_,h3_,i_]:=Evaluate[(H[l1, l2, l3, l4, h1, h2, h3, h4]*L[h1, h2, h3, h4] /. 
              h4 -> i - h1 - h2 - h3)]

M[0, 0, 0, 3, 0, 0, 0, 3] // Expand

M[0, 0, 0, 3, 0, 0, 0, 3] // Expand // Length

U[-1,j_]=0;

U[0,j_]=1;

summandForU[i_,j_]:=Expand[
            D[U[i, j], z] + (i + j - m)*b[1][z]*
                U[i, j] + (m - i - j + 1)*(1 - i - j)*b[2][z]*
                U[i - 1, j]]

Do[U[i,j_]=Module[{u, r},
u = Expand[summandForU[i - 1, r]];Sum[Coefficient[u, r, n]*SumOfPowers[n, j],{n, 0, 2*i - 1}]],{i, 1, p}]

V[i1_,i2_,i3_,i4_]:=Sum[U[i1 - r1, r1]*U[i2 - r2, r2]*U[i3 - r3, r3]*
                U[i4 - r4, r4]*w[r1, r2, r3, r4][z],{r1,0,i1},{r2,0,i2},{r3, 0, i3},{r4, 0, i4}]

W[l1_,l2_,l3_,l4_,h1_,h2_,h3_,i_]:=Evaluate[(H[l1, l2, l3, l4, h1, h2, h3, h4]*V[h1, h2, h3, h4] /. 
              h4 -> i - h1 - h2 - h3)]

M[0, 0, 0, 3, 0, 0, 0, 3] - W[0, 0, 0, 3, 0, 0, 0, 3] // 
      Simplify

W[0, 0, 0, 3, 0, 0, 0, 3] // Expand

W[0, 0, 0, 3, 0, 0, 0, 3] // Expand // Length

A[l1_,l2_,l3_,l4_,i_]:=-1/(l1 + l2 + l3 + l4 + i - 1)

B[l1_,l2_,l3_,l4_,i_]:=(l1 + l2 + l3 + l4 - i)/(l1 + l2 + l3 + l4 + i - 
                2)

difference[l1_,l2_,l3_,l4_]:=Module[{t, u},Do[ t[h1, h2, h3, 0] = 0,{h1, 0, l1},{h2, 0, l2},{h3, 0, l3}];Do[ t[h1, h2, h3, 1] = 0,{h1, 0, l1},{h2, 0, l2},{h3, 0, l3}];Do[ t[h1, h2, h3, i] = 
                      M[l1, l2, l3, l4, h1, h2, h3, i] + 
                        A[l1, l2, l3, l4, i - 1]*
                          D[ t[h1, h2, h3, i - 1], z] + 
                        B[l1, l2, l3, l4, i - 1]*a[2][z]*
                          t[h1, h2, h3, i - 2],{i, 2, l1 + l2 + l3 + l4},{h1, 0, l1},{h2, 0, l2},{h3, 0, l3}];Inv[l1, l2, l3, l4]=Sum[t[h1, h2, h3, l1 + l2 + l3 + l4],{h1, 0, l1},{h2, 0, l2},{h3, 0, l3}];Do[ u[h1, h2, h3, 0] = 0,{h1, 0, l1},{h2, 0, l2},{h3, 0, l3}];Do[u[h1, h2, h3, 1] = 0,{h1, 0, l1},{h2, 0, l2},{h3, 0, l3}];Do[ u[h1, h2, h3, i] = 
                      W[l1, l2, l3, l4, h1, h2, h3, i] + 
                        A[l1, l2, l3, l4, 
                            i - 1]*(D[u[h1, h2, h3, i - 1], 
                                z] + (i - 1)*b[1][z]*
                                u[h1, h2, h3, i - 1]) + 
                        B[l1, l2, l3, l4, i - 1]*b[2][z]*
                          u[h1, h2, h3, i - 2],{i, 2, l1 + l2 + l3 + l4},{h1, 0, l1},{h2, 0, l2},{h3, 0, l3}];J[l1, l2, l3, l4]=Sum[u[h1, h2, h3, l1 + l2 + l3 + l4],{h1, 0, l1},{h2, 0, l2},{h3, 0, l3}];Print["The number of terms in Inv[", 
                  l1, ", ", l2, ", ", l3, ", ",  
                  l4, "] is ", Length[Expand[Inv[l1, l2, l3, l4]]]];Print["The number of terms in J[", l1, ", ", 
                  l2, ", ", l3, ", ", l4, "] is ", 
                  Length[Expand[J[l1, l2, l3, l4]]]];Print["The memory currently used (in bytes) is \
", MemoryInUse[]];Print["Inv[", l1, ", ", l2, ", ", 
                  l3, ", ", l4, "] - J[", l1,  ", ", 
                  l2, ", ", l3, ", ", l4, "] = ", 
                  Expand[Inv[l1, l2, l3, l4] - J[l1, l2, l3, l4]]];Print["The maximum memory used (in bytes) is ", 
                  MaxMemoryUsed[]];
Print[ Date[] ]; Print["     "];Clear[t, u, Inv, J]]

Do[ difference[0, 0, 0, l4],{l4,3,p}]

Do[ 
      difference[l1, l2,  l3, l4], {l1, 0, p}, {l2, l1, p - l1}, {l3, 
        Max[1, l2], p - l1 - l2}, {l4, l3, p - l1 - l2 - l3}]