Periodicity of earthquakes and the invariance of the gravitational constant