I agree with what you've done so far. Now you just need to write S_b in base b. It will help to break things up into cases where b is even or b is odd.

And these identities might also help.

b^(4)/2 + b^(2)/2 = b^(3)(b/2) + b(b/2)

b^(4)/2 + b^(2)/2 = b^(3)(b-1)/2 + b^(2)(b+1)/2