Skip to main content
3 of 3
added 52 characters in body
vazt
  • 301
  • 1
  • 4

C (gcc), 85 81 75 bytes

Saved 4 bytes and then 6 bytes thanks to @ceilingcat's re-ordering of assignments

r[5];f(n){r[1]=(n=(n-(*r=n*n*n))/6+1)*n*n--;r[3]=r[4]=-n*n*n;r[2]=--n*n*n;}

Try it online!

vazt
  • 301
  • 1
  • 4