Special pythagorean triplet: Difference between revisions
→{{header|F_Sharp|F#}}
Line 60:
=={{header|F_Sharp|F#}}==
Here I present a solution based on the ideas on the discussion page. It finds all Pythagorean triplets whose elements sum to a given value. It runs in O[n] time. Normally I would exclude triplets with a common factor but for this demonstration
<lang fsharp>
// Special pythagorean triplet. Nigel Galloway: August 31st., 2021
|