Answer
$1995$
Work Step by Step
We know that $M=\log\frac{I}{S}$ and thus $10^M=\frac{I}{S}$
Here, if $I_1,I_2$ are the intensities, we have:
$I_1=S10^{6.4},I_2=S10^{3.1}$
Hence,
$\frac{I_1}{I_2}=\frac{10^{6.4}}{10^{3.1}}\approx1995$
Thus, the Japan quake was more intense than the Pennsylvania quake by $1995$ times.