Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (Poisk 1arg 2arg)
- (define (ostatok x z n)
- (if (or (= 1 x) (= 1 z)) 1
- (if (> n (or x z)) #f
- (if (and (= 0 (remainder x n)) (= 0 (remainder z n))) n
- (ostatok x z (+ 1 n))))))
- (ostatok 1arg 2arg 2))
- (define (help arg n z)
- (if (= n arg) z
- (if (= 0 (remainder arg n)) (help arg (+ 1 n) (cons n z))
- (help arg (+ 1 n) z))))
- (define (perfect X)
- (if (= 0 X) #f
- (if (= X (apply + (help X 1 '()))) #t #f)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement