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 Solvers6
Suggested Problems
-
How long do each of the stages of the rocket take to burn?
564 Solvers
-
Usage of java.math : N Choose K with unlimited precision
54 Solvers
-
1698 Solvers
-
Splitting Square - Problem the third
37 Solvers
-
Easy Sequences 27: Product of Radicals of Integers
11 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.