How to compare earthquake magnitudes
Taken straight-out from Prof. L. Braile's collection of earthquake hazard information, that explains it quite nicely:


  The magnitude scale is really comparing amplitudes of waves on a seismogram, not the STRENGTH (energy) of the earthquakes.


While one unit of magnitude is 10 times the amplitude on a seismogram, one unit of magnitude represents $10^{1.5}$ times (approximately 32 times) the energy, based on the long-standing empirical formula

$$\log{E} \propto 1.5M$$

thus

$$E \propto 10^{1.5M}$$

where $E$ is energy and $M$ is magnitude.

The example set in the webpage is to compare how much bigger would a 9.7 magnitude earthquake be in comparison to a 6.8 magnitude earthquake:


The magnitude scale is logarithmic, so a magnitude 9.7 earthquake is $\frac{10^{9.7}}{10^{6.8}} = 794.328$ times bigger on the seismogram than a magnitude 6.8 earthquake.
Measuring the change in energy, however, shows that the 9.7 earthquake is $\frac{{10^{1.5}}^{9.7}}{{10^{1.5}}^{6.8}} = 10^{1.5 \times (9.7-6.8)} = 22~387$ times the energy of a 6.8 earthquake.


Comparison of earthquake "size" on seismograms: this image from Nevada Seismological Lab's Living with Earthquakes in Nevada

A graphical comparison of earthquake energy release, a video by the US NWS Pacific Tsunami Warning Center (PTWC).

The USGS has a calculator for magnitude difference.

And there's a calculator for seismic energy and several equivalences. Unfortunately, most of the equivalences are related to the USA.

See Brian Hill's answer that explains that with the original Richter scale, one unit of magnitude is apprimately $31^{1}$ times the energy, and two units of magnitude are $31^{2}$ times the energy, and so on.

In short: you are half-right (one unit of magnitude it is 10 times bigger on the seismogram, not in energy), and the book is right (two units of magnitude are 1000 times stronger).