One idea that I had was to inline the factoring logic into twice-
composite. Who cares about the factors? We just want to know if there
are two or not:
(defn twice-composite? [n]
(loop [ps prime-seq
tmp n
p-count 0]
(if (< 2 p-count)
false
(if (= 1 tmp)
is nowhere near optimal, and I
know that in order to efficiently solve a lot of the Euler problems,
you cannot simply brute force them; you need to choose your algorithm
wisely.
Anyway... any suggestions would be greatly appreciated.
dan kefford
On Nov 2, 4:52 pm, Alan wrote:
> Usually it'
out there.
Thanks in advance,
dan kefford
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
first post.
OK... I'm trying to take Clojure for a spin on Project Euler problems.
I have source files for each problem that I have solved and although I
can refer to and invoke any one of them explicitly from a main class,
I cannot seem to figure out how to refer to them all at once so that I
can choose to ru