- A triangle is considered a right triangle if one of the inner angles is exactly 90 degrees.
- A number is considered rational if it can be represented by a ratio of integers, i.e.,
p/q, where both
- A number
nis a congruent number if there exists a right triangle of area
nwhere all three sides are rational.
- This is OEIS A003273.
This is a decision-problem challenge. Given an input number,
x, output a distinct and consistent value if
x is a congruent number, and a separate distinct and consistent value if
x is not a congruent number. The output values do not necessarily need to be truthy/falsey in your language.
For the purposes of this challenge, you can assume that the Birch and Swinnerton-Dyer conjecture is true. Alternatively, if you can prove the Birch and Swinnerton-Dyer conjecture, go claim your $1,000,000 Millennium prize. ;-)
True for congruent numbers and
5 True 6 True 108 False
Rules and Clarifications
- Input and output can be given by any convenient method.
- You can print the result to STDOUT or return it as a function result. Please state in your submission what values the output can take.
- Either a full program or a function are acceptable.
- Standard loopholes are forbidden.
- This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.