Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,23 @@
T CalkinWilf
n = 1
d = 1
F ()()
V r = (.n, .d)
.n = 2 * (.n I/ .d) * .d + .d - .n
swap(&.n, &.d)
R r
print(The first 20 terms of the Calkwin-Wilf sequence are:)
V cw = CalkinWilf()
[String] seq
L 20
V (n, d) = cw()
seq.append(I d == 1 {String(n)} E n/d)
print(seq.join(, ))
cw = CalkinWilf()
V index = 1
L cw() != (83116, 51639)
index++
print("\nThe element 83116/51639 is at position "index in the sequence.)