Advertisement
Guest User

Untitled

a guest
May 19th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.23 KB | None | 0 0
  1. (defun perfect-square-p (n)
  2.   "Test if N (a positive integer) can be of form x^2, where x is also an integer."
  3.   (mvb (i e) (truncate n)
  4.     (and (positive-integer-p i)
  5.          (zerop e)
  6.          (= (expt (isqrt i) 2) i))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement