diff --git a/fast-prime?.lisp b/fast-prime?.lisp
index e69de29..4a167c9 100644
--- a/fast-prime?.lisp
+++ b/fast-prime?.lisp
@@ -0,0 +1,18 @@
+(in-package :math-algo)
+
+(defun my-fast-prime? (n times)
+  (defun my-expmod (base exp m)
+    (cond ((= exp 0) 1)
+          ((my-even? exp)
+           (rem (my-square (my-expmod base (my-halve exp) m))
+                m))
+          (t
+           (rem (* base (my-expmod base (- exp 1) m))
+                m))))
+  (defun my-fermat-test (n)
+    (defun my-try-it (a)
+      (= (my-expmod a n n) a))
+    (my-try-it (+ 1 (random (- n 1)))))
+  (cond ((= times 0) t)
+        ((my-fermat-test n) (my-fast-prime? n (- times 1)))
+        (t nil)))
diff --git a/math-algorithm.asd b/math-algorithm.asd
index f9469b8..816eb95 100644
--- a/math-algorithm.asd
+++ b/math-algorithm.asd
@@ -20,9 +20,11 @@
    (:file "factorial" :depends-on ("packages"))
    (:file "fast-expt" :depends-on ("packages" "square" "even?" "halve"))
    (:file "fast-mult" :depends-on ("packages" "double" "halve"))
+   (:file "fast-prime?" :depends-on ("packages" "even?" "halve"))
    (:file "fib" :depends-on ("packages"))
    (:file "gcd" :depends-on ("packages"))
    (:file "halve" :depends-on ("packages"))
    (:file "odd?" :depends-on ("packages"))
+   (:file "prime?" :depends-on ("packages"))
    (:file "square" :depends-on ("packages"))
    (:file "sqrt" :depends-on ("packages" "abs" "average" "square"))))
diff --git a/packages.lisp b/packages.lisp
index 5a0b494..ed420ed 100644
--- a/packages.lisp
+++ b/packages.lisp
@@ -20,11 +20,13 @@
            my-fast-expt-do-impl
            my-fast-mult-recu-impl
            my-fast-mult-iter-impl
+           my-fast-prime?
            my-fib-do-impl
            my-fib-recu-impl
            my-fib-iter-impl
            my-gcd-iter-impl
            my-halve
            my-odd?
+           my-prime?
            my-square
            my-sqrt))