Anonymous user
Stern-Brocot sequence: Difference between revisions
m
Fix terminal condition error (stopped at 999 instead of 1000).
(Added a Scheme implementation.) |
m (Fix terminal condition error (stopped at 999 instead of 1000).) |
||
Line 5,566:
(gcd b (remainder a b))))))
(do ((index 1 (1+ index)))
((>
(let ((sbgcd (gcd (stern-brocot index) (stern-brocot (1+ index)))))
(when (not (= 1 sbgcd))
|