6e9dc46857b5

Woodall
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 21 Feb 2017 20:32:36 +0000
parents 7c082c0289d5
children 0d2671fa1875
branches/tags (none)
files src/primes.lisp

Changes

--- a/src/primes.lisp	Mon Feb 20 17:14:25 2017 +0000
+++ b/src/primes.lisp	Tue Feb 21 20:32:36 2017 +0000
@@ -162,3 +162,9 @@
                 (incf seen)
                 (when (= seen n)
                   (return i))))))
+
+(defun woodall (n)
+  (1- (* n (expt 2 n))))
+
+(defun woodall-prime-p (n)
+  (primep (woodall n)))