Oh yeah thats a nice hack, thanks for that
I think I thought of smth else, since you know (px^2+qx+r) and 10(px^2+qx+r) +1 = 111...., is that a possible recipe for some recursive solution?
The ms mentioned this at the bottom and I was just thinking about it but cant really figure out a way to get p,q,r
edit: also just wondering with your method, I think you assume p,q,r are positive with your guesses, but if you were doing this in a real exam, and you dont know if they are +ve or -ve (other than p) would you just try p+q+r = 1,11,111... until something sticks? I think that might be faster rather than doing it the ms way..