use available library function
Missed this earlier
This commit is contained in:
parent
b48710bab3
commit
01f8ff5eb8
|
@ -15,8 +15,7 @@
|
||||||
(only-in math/number-theory
|
(only-in math/number-theory
|
||||||
binomial
|
binomial
|
||||||
integer-root
|
integer-root
|
||||||
prime-divisors
|
factorize)
|
||||||
prime-exponents)
|
|
||||||
|
|
||||||
"error.rkt")
|
"error.rkt")
|
||||||
|
|
||||||
|
@ -1328,8 +1327,9 @@
|
||||||
|
|
||||||
(define (prime-factorize k)
|
(define (prime-factorize k)
|
||||||
(apply append
|
(apply append
|
||||||
(for/list ([divisor (in-list (prime-divisors k))]
|
(for/list ([d-e (in-list (factorize k))])
|
||||||
[exponent (in-list (prime-exponents k))])
|
(define divisor (first d-e))
|
||||||
|
(define exponent (second d-e))
|
||||||
(for/list ([_ (in-range exponent)])
|
(for/list ([_ (in-range exponent)])
|
||||||
divisor))))
|
divisor))))
|
||||||
(module+ test
|
(module+ test
|
||||||
|
|
Loading…
Reference in New Issue
Block a user