divisors   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/contrib/word_count.xtm

Implementation

(bind-func divisors
  "find the proper divisors of n"
  (lambda (n)
    (letz ((candidates (range 1 (- n 1))))
      (filter (lambda (d) (= (% n d) 0)) candidates))))


Back to Index

Similar Entries

  • divisors    xtlang