On Sat, 1 Jul 2017 17:14:01 +0200, Jens Axel Søgaard
<jensa...@soegaard.net> wrote:

>Hi Billy
>
>Just curious. How long does the simple solution take:
>
>#lang racket/base
>(require math/number-theory)
>
>(define (f n)
>  (for/sum ([x (in-range 1 (+ n 1))]
>            #:when (= (length (divisors x)) 8))
>           1))
>
>(f 10e6)
>
>/Jens Axel

I think you mean "1e6" (1 million) per the Euler problem.

Using Racket 6.9 on Win7, simple (1e6) takes ~16.4 seconds on my
ancient 5yo i7-3770.  Billy's unsafe version takes ~4.2 seconds.

George

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to