You are viewing a single comment's thread. Return to all comments →
way to solution
13^2−10^2−7^2=20 (a+x)^2 - a^2 - (a-x)^2 = n
a^2+2ax+x^2-a^2-(a^2-2ax+x^2) = n
a^2+2ax+x^2-a^2-a^2+2ax-x^2 = n 4ax-a^2 = n a(4x-a) = n
Since n, x and a are integers it raises following conditions,
n%a==0;
The interesing thing is that, n should be perfectly divisible by a
4x-a = n/a 4x = n/a + a
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #136: Singleton difference
You are viewing a single comment's thread. Return to all comments →
way to solution
13^2−10^2−7^2=20 (a+x)^2 - a^2 - (a-x)^2 = n
a^2+2ax+x^2-a^2-(a^2-2ax+x^2) = n
a^2+2ax+x^2-a^2-a^2+2ax-x^2 = n 4ax-a^2 = n a(4x-a) = n
Since n, x and a are integers it raises following conditions,
n%a==0;
The interesing thing is that, n should be perfectly divisible by a
4x-a = n/a 4x = n/a + a