From 047d9cad3eeb134dbd043413bbc039a78f87e707 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 9 Apr 2013 12:22:41 -0700 Subject: [PATCH] math.factorials: cleanup orial-primes. --- extra/math/factorials/factorials.factor | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/extra/math/factorials/factorials.factor b/extra/math/factorials/factorials.factor index 8da12f447c..10607f1aef 100644 --- a/extra/math/factorials/factorials.factor +++ b/extra/math/factorials/factorials.factor @@ -102,23 +102,23 @@ ALIAS: pochhammer rising-factorial : exponential-factorial ( n -- m ) dup 1 > [ [1,b] 1 [ swap ^ ] reduce ] [ drop 1 ] if ; + + : factorial-prime? ( n -- ? ) { [ prime? ] - [ - 1 1 [ pick over - 1 <= ] [ - drop [ 1 + ] [ factorial ] bi - ] until nip - abs 1 = - ] + [ [ factorial ] orial-prime? ] } 1&& ; : primorial-prime? ( n -- ? ) { [ prime? ] [ 2 > ] - [ - 1 1 [ pick over - 1 <= ] [ - drop [ 1 + ] [ primorial ] bi - ] until nip - abs 1 = - ] + [ [ primorial ] orial-prime? ] } 1&& ;