pythagorean_triplets

Run Settings
LanguageJulia
Language Version
Run Command
function pythagorean_triplets(limit) (m, n ,c) = 2, 0, 0 while c < limit for n = 1:m -1 a = m ^ 2 - n ^ 2 b = 2 * m * n c = m ^ 2 + n ^ 2 c > limit ? break : @show a, b, c end m += 1 end end limit = 20 pythagorean_triplets(limit)
Editor Settings
Theme
Key bindings
Full width
Lines