Jump to content

Pell's equation: Difference between revisions

 
Line 1,070:
=={{header|langur}}==
{{trans|D}}
<syntaxhighlight lang="langur">val .fun = fn( .a, .b, .c) {: [.b, .b * .c + .a] }
 
val .solvePell = fn(.n) {
Line 1,099:
for .n in [61, 109, 181, 277, 8941] {
val .x, .y = .solvePell(.n)
writeln $"x² - \{{.n;}}y² = 1 for:\n\tx = \{{.x:fn C;}}\n\ty = \{{.y:fn C;}}\n"
}
</syntaxhighlight>
890

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.