Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun myfun (x n) (sqrt (- (expt (+ x (isqrt n)) 2) n)))
- (defun ferma (numb)
- (if (= 0.0 (rem numb (sqrt numb)))
- (cons (sqrt numb) (sqrt numb))
- (loop named test
- for x from 1 to MOST-POSITIVE-FIXNUM
- when (= 0.0 (rem (myfun x numb) 1))
- do (return-from test (cons
- (round (- (+ (isqrt numb) x) (myfun x numb)))
- (round (+ (+ (isqrt numb) x) (myfun x numb)))
- )))))
- (defun fferma (numb)
- (if (= numb (cdr (ferma numb)))
- numb
- (list (fferma (car (ferma numb))) (fferma (cdr (ferma numb))))
- ))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement