i tried the first couple on paper only the number 1 is working. so i guess that it
How many positive integer solutions are there n such that both n and n+99 are perfect squares?
I believe there is only 1 solution.
Any tips on how to tackle this? I haven't really come up with a method or a formula to calculate it, simply gone through the first 20 squares, and I doubt there will be anything after that
Please help out, thanks
See Dario Alpern's quadratic Diophantine solver and plug in and select "step-by-step".
Edit: Actually, the steps shown for this particular problem aren't as illuminating as they often are. Not sure the best way to work it out on paper.
Edit 2: See Soroban's post.. seems so obvious now.
By the way, I worked it out by brute force initially as well using PARI/GP which is a great tool (and hopefully you won't get spoiled by it). I wrote
Could also have usedCode:f(n)=if(sqrt(n)==floor(sqrt(n)),1,0) for(i=0,10000,if(f(i)&&f(i+99),print(i)))
which ought to be a bit more efficient.Code:f(n)=if(floor(sqrt(n))^2==n,1,0)