Fermat numbers: Difference between revisions

m (→‎{{header|ALGOL 68}}: Added works with)
Line 1,379:
=={{header|langur}}==
{{trans|Python}}
<syntaxhighlight lang="langur">val .fermat = ffn(.i) 2 ^ 2 ^ .i + 1
 
val .factors = ffn(var .x) {
for[.f=[]] .i, .s = 2, trunc .x ^/ 2; .i < .s; .i += 1 {
if .x div .i {
Line 1,406:
writeln $"F\(.i + 16x2080:cp) factors: ", .fac
}
}
}</syntaxhighlight>
 
{{out}}
I just ran an initial test. Maybe I'll take the time to calculate more factors later.
<pre>first 10 Fermat numbers
F₀ = 3
885

edits