Farey sequence: Difference between revisions

m (syntax highlighting fixup automation)
Line 1,876:
}
 
val .testFarey = f() {
writeln "Farey sequence for orders 1 through 11"
for .i of 11 {
writeln $"\.i:2;: ", join " ", map(f $"\.f[1];/\.f[2];", .farey(.i))
}</syntaxhighlight>
}
}
 
.testFarey()
Theoretically, the following should work, but it's way too SLOW to run in langur 0.10. Maybe another release will be fast enough.
 
<syntaxhighlight lang="langur">writeln "count of Farey sequence fractions for 100 to 1000 by hundreds"
writeln()
<syntaxhighlight lang="langur">writeln "count of Farey sequence fractions for 100 to 1000 by hundreds"
for .i = 100; .i <= 1000; .i += 100 {
writeln $"\.i:4;: ", len(.farey(.i))
890

edits