40MW * 200 seconds * 5 fuel cells = 40GJ
Integrating the power output curve over 32 half lives:
integrate 600000*e^(x*(-ln(2)/(12*60*60))) dx from x=0 to 16*12*60*60 means you get 37.39GJ in total out of your RITEG.
You did your math.

The reactor should last for about 398684 or 398685 seconds (aka 12 * 60 * 60 * log(600) / log(2)) which yields about 37.332 GJ of energy during the reactor's actual lifetime, which is only about 9.2 half-lives.