A positive integer x is called a regular number, if and only if there exist a non-negative integer k, such that
. For some reason, such a number is also refered to as an ugly number. Below are the first few regular numbers:
Pythagorean triangles are right triangles with all sides having integer lengths. Write a program that counts all Pythagorean triangles whose areas are non-regular numbers and with no sides greater than a given limit s.
Below is the list of all Pythagorean triangles with non-regular areas and with all sides
:
Therefore, for
, your program output should be
.
Solution Stats
Problem Comments
5 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers4
Suggested Problems
-
1434 Solvers
-
Pandigital number n°3 (Inspired by Project Euler 32)
43 Solvers
-
129 Solvers
-
395 Solvers
-
237 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
I am getting different answers for 1e8 and 2^27. All of my other results match yours. I get 271357762 for 1e8 and 370497786 for 2^27. Can you check your answers again.
I am getting exactly the same discrepancy as David for the highest valued arguments.
Same issue as David and William, getting the same values. It appears they both solved the problem. Was it a real solution or a hack, and if real, any clues?
William's, David's, and my solutions all have total hacks to fit Ramon's solution. I'm going to dig a bit to try to figure out which is correct.; identify the 75 and 134 solutions everybody but Ramon finds and see if they're legit.
The problem is round off in Ramon's search for ugly Pythagorean triangles. For 2^27, he finds 115 solutions with x=1 and y=z, one with x=2 and y=z, and 17 solutions with x and y even and z odd., none of which can be Pythagorean triples.