We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
So after substutions we can calculate relation between a and b given that n=const.
So we can substitute everything into a*b*c and get some complicated function. After some more math magic on paper I've came up with neat solution. It's guaranteed that the first solution is already the best one.
Project Euler #9: Special Pythagorean triplet
You are viewing a single comment's thread. Return to all comments →
We know that
c = n - a - b
But also we know that
a^2 + b^2 = c^2
So after substutions we can calculate relation between
a
andb
given thatn=const.
So we can substitute everything into
a*b*c
and get some complicated function. After some more math magic on paper I've came up with neat solution. It's guaranteed that the first solution is already the best one.