## Problem Description :

A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a^2 + b^2 = c^2
For example, 32 + 42 = 9 + 16 = 25 = 52. There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc.

## Concept :

We have following two equations.

1) a^2+b^2=c^2
2) a+b+c=1000

on solving these equations mathematically.

1<=a<=999
b=(1000^2-(2*a*1000))/(2*(1000-a))
c=1000-b-a

## References :

https://projecteuler.net/problem=9

https://en.wikipedia.org/wiki/Pythagorean_triple

https://docs.oracle.com/javase/7/docs/api/java/lang/Math.html

Thank you friends, I hope you have clearly understood the solution of this problem. If you have any doubt, suggestion or query please feel free to comment below. You can also discuss this solution in our forum.

Tags : Project Euler Problem 9 solution in Java, Mathematics problems, Special Pythagorean Triplet, for loop, if else statement. Project Euler | Problem 9 | Special Pythagorean Triplet Reviewed by Rohit Agarwal on 3/10/2017 Rating: 5