A divisor of must be of the form , with and . If it does not divide then either or .
Now comes the tricky part. The remaining condition is that . I suggest that you investigate this by choosing a random value of p between 31 and 62, say p=45, and looking at how many values of q satisfy the condition . [Hint: take logs.] That may possibly give you some insight into how to tackle the problem in general.
This question has already been discussed, but I have not tried to find a more elegant solution.