With `D=4`, the RHS is:
```
In [1]: D = 4; -4*D**6 + 120*D**5 - 1040*D**4 + 3360*D**3 - 4480*D**2 + 2048*D                                                                        
Out[1]: -8192                                                                                                                                         
```