Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
22
Task/Calkin-Wilf-sequence/EasyLang/calkin-wilf-sequence.easy
Normal file
22
Task/Calkin-Wilf-sequence/EasyLang/calkin-wilf-sequence.easy
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
subr first
|
||||
n = 1 ; d = 1
|
||||
.
|
||||
proc next . .
|
||||
n = 2 * (n div d) * d + d - n
|
||||
swap n d
|
||||
.
|
||||
print "The first 20 terms of the Calkwin-Wilf sequence are:"
|
||||
first
|
||||
for i to 20
|
||||
write n & "/" & d & " "
|
||||
next
|
||||
.
|
||||
print ""
|
||||
#
|
||||
first
|
||||
i = 1
|
||||
while n <> 83116 or d <> 51639
|
||||
next
|
||||
i += 1
|
||||
.
|
||||
print "83116/51639 is at position " & i
|
||||
Loading…
Add table
Add a link
Reference in a new issue