Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Arithmetic-Rational/Scheme/arithmetic-rational.ss
Normal file
8
Task/Arithmetic-Rational/Scheme/arithmetic-rational.ss
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
; simply prints all the perfect numbers
|
||||
(do ((candidate 2 (+ candidate 1))) ((>= candidate (expt 2 19)))
|
||||
(let ((sum (/ 1 candidate)))
|
||||
(do ((factor 2 (+ factor 1))) ((>= factor (sqrt candidate)))
|
||||
(if (= 0 (modulo candidate factor))
|
||||
(set! sum (+ sum (/ 1 factor) (/ factor candidate)))))
|
||||
(if (= 1 (denominator sum))
|
||||
(begin (display candidate) (newline)))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue