# How to approach this number theory problem?

I was working on the Volume 2 book published by the Art of Problem Solving company when I came across a problem that I just didn't know how to start. The problem is as follows:

Q: Are there integers m and n such that $$5m^2 - 6mn + 7n^2 = 1985?$$ (IMO 1985)

Here is the solution (I made it a spoiler if anyone wants to solve the problem first):

A: Multiplying the equation by 5 and completing the square to get perfect squares, we obtain $$(5m-3n)^2 + 26n^2 = 9925$$. Taking the equation (mod 13) to eliminate the $$26n^2$$, we have $$(5m-3n)^2 \equiv 6 \pmod {13}$$. But the squares mod 13 are 0, 1, 4, 9, 3, 12, and 10; since 6 is not a square [I think it should say "quadratic residue" instead of "square"], there can be no such m and n.

I completely understand each step taken in the solution but I am still confused as to what I should have done before and during my attempt at solving the problem in order to be able to think of that method during a timed test. Is it just practice and having exposure to many types of problems, and what would you guys have done when solving/seeing the problem for the first time?

• This is probably not very insightful but for me, the left side screams to be made into a square - which is what I would try doing first. Commented Dec 31, 2019 at 19:35
• It's a standard reduction to Pell form that goes back to Legendre, see this answer. Here it's not much more than completing the square. Commented Dec 31, 2019 at 19:55
• Also worth knowing is completing a product (see the "Linked" questions there for many worked examples). Commented Dec 31, 2019 at 20:00
• Yes, that makes sense. Thank you to both of you. Commented Dec 31, 2019 at 20:50
• In answer to your more general question, there is no guaranteed way of solving a difficult problem. You usually have to try many different approaches before succeeding. One of the basic ideas is to ask yourself "do I know any result like this?", "what does this remind me of?". Commented Jan 1, 2020 at 19:22