Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Farey-sequence/11l/farey-sequence.11l
Normal file
19
Task/Farey-sequence/11l/farey-sequence.11l
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
F farey(n)
|
||||
V a = 0
|
||||
V b = 1
|
||||
V c = 1
|
||||
V d = n
|
||||
V far = ‘0/1 ’
|
||||
V farn = 1
|
||||
L c <= n
|
||||
V k = (n + b) I/ d
|
||||
(a, b, c, d) = (c, d, k * c - a, k * d - b)
|
||||
far ‘’= a‘/’b‘ ’
|
||||
farn++
|
||||
R (far, farn)
|
||||
|
||||
L(i) 1..11
|
||||
print(i‘: ’farey(i)[0])
|
||||
|
||||
L(i) (100..1000).step(100)
|
||||
print(i‘: ’farey(i)[1]‘ items’)
|
||||
Loading…
Add table
Add a link
Reference in a new issue