What magnitude of earthquake would release energy equivalent to 35 trillion jules?

I know the formula is:

E= (2.5 X 10^4) X 10^1.5 X M

I got a magnitude of 6.1. Is that correct?