[plt-scheme] Re: Unreasonably slow

From: Thomas Chust (chust at web.de)
Date: Tue Nov 4 18:43:36 EST 2008

rf schrieb:
> This is a bit late, but the solution to "What is the smallest number
> that is evenly divisible by all of the numbers from 1 to 20"
> is much simpler:
> (require (planet "math.ss" ("soegaard" "math.plt" 1 3)))
> (apply lcm (interval 1 20))


although (planet soegaard/math:1) is a very nice and useful library, I
see no need to load extension modules for built-in functionality:

  (apply lcm (build-list 20 add1))

lcm is part of R5RS and loading the math library to construct a list of
integers is clearly overkill.

However, solving the problems by throwing some library functionality at
them is maybe not the intention of Project Euler ;-)


Posted on the users mailing list.