Special pythagorean triplet: Difference between revisions

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 itI is betterprefer to leave them.
<lang fsharp>
// Special pythagorean triplet. Nigel Galloway: August 31st., 2021
2,172

edits