p047.scm 358 B

123456789101112131415
  1. ;; Distinct Prime Factors
  2. (define-module (solved p047))
  3. (use-modules (euler factor)
  4. (srfi srfi-1))
  5. (define (n-consecutive-vals-w/-k-distinct-prime-factors n k)
  6. (let lp ([i 1] [acc '()])
  7. (cond
  8. [(= n (length acc)) acc]
  9. [(= k (length (delete-duplicates (trial-factor i))))
  10. (lp (1+ i) (cons i acc))]
  11. [else (lp (1+ i) '())])))