logarithmic function richter scale formula