Project Euler problem 9 Special Pythagorean triplet

aa+bb=cc
a+b+c=1000
aa+bb+cc+2ab+2ac+2bc=1000000
2cc+2ab+2ac+2bc=1000000
cc+ab+ac+bc=500000
ab+1000c=500000
ab+1000(1000-a-b)=500000
ab+1000000-1000a-1000b=500000
1000a+1000b=ab+500000
ab=1000a+1000b-500000
ab=1000(500-c)
a+b+c > 3a 
a<1000/3
a+b+c > a+2b
b< (1000-a)/2



Comments

Popular posts from this blog

Check MySQL query history from command line