Pythagorean triples/Java/Brute force primitives: Difference between revisions
Content added Content deleted
(Fursther optimization by skipping more a,b pair candidates (noted in the comments), rm runtime calculations) |
m (Moved the LIMIT declaration but forgot to take the comment with it) |
||
Line 17: | Line 17: | ||
B127 = BigInteger.valueOf(127), |
B127 = BigInteger.valueOf(127), |
||
B191 = BigInteger.valueOf(191); |
B191 = BigInteger.valueOf(191); |
||
⚫ | |||
private static BigInteger LIMIT = BigInteger.valueOf(100); |
private static BigInteger LIMIT = BigInteger.valueOf(100); |
||
Line 70: | Line 71: | ||
long primCount = 0; |
long primCount = 0; |
||
⚫ | |||
BigInteger peri2 = LIMIT.divide(BigInteger.valueOf(2)), |
BigInteger peri2 = LIMIT.divide(BigInteger.valueOf(2)), |
||
peri3 = LIMIT.divide(BigInteger.valueOf(3)); |
peri3 = LIMIT.divide(BigInteger.valueOf(3)); |