Special pythagorean triplet: Difference between revisions
Content added Content deleted
Catskill549 (talk | contribs) (added AWK) |
|||
Line 725: | Line 725: | ||
(a, b, c) = (200, 375, 425) |
(a, b, c) = (200, 375, 425) |
||
0.001073 seconds (20 allocations: 752 bytes) |
0.001073 seconds (20 allocations: 752 bytes) |
||
</pre> |
|||
=={{header|Mathematica}} / {{header|Wolfram Language}}== |
|||
<lang Mathematica>sol = First@ |
|||
FindInstance[ |
|||
a + b + c == 1000 && a > 0 && b > 0 && c > 0 && |
|||
a^2 + b^2 == c^2, {a, b, c}, Integers]; |
|||
Join[List @@@ sol, {{"Product:" , a b c /. sol}}] // TableForm</lang> |
|||
{{out}}<pre> |
|||
a 200 |
|||
b 375 |
|||
c 425 |
|||
Product: 31875000 |
|||
</pre> |
</pre> |
||