Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
|
|
@ -1,16 +1,16 @@
|
|||
val .farey = f(.n) {
|
||||
val .farey = fn(.n) {
|
||||
var .a, .b, .c, .d = 0, 1, 1, .n
|
||||
while[=[[0, 1]]] .c <= .n {
|
||||
val .k = (.n + .b) // .d
|
||||
.a, .b, .c, .d = .c, .d, .k x .c - .a, .k x .d - .b
|
||||
.a, .b, .c, .d = .c, .d, .k * .c - .a, .k * .d - .b
|
||||
_while ~= [[.a, .b]]
|
||||
}
|
||||
}
|
||||
|
||||
val .testFarey = impure f() {
|
||||
val .testFarey = impure fn() {
|
||||
writeln "Farey sequence for orders 1 through 11"
|
||||
for .i of 11 {
|
||||
writeln $"\.i:2;: ", join " ", map(f $"\.f[1];/\.f[2];", .farey(.i))
|
||||
writeln $"\.i:2;: ", join " ", map(fn(.f) $"\.f[1];/\.f[2];", .farey(.i))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue