Discussion:
Interesting challenge
(too old to reply)
David Nolen
2010-12-30 17:03:14 UTC
Permalink
http://groups.google.com/group/qilang/browse_thread/thread/e4a2f534fad5032a

"I contend that this kind of problem cannot be solved (efficiently) in any
pure functional programming language. You may disagree"

:D

David
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to ***@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
Mike Meyer
2010-12-30 17:41:55 UTC
Permalink
On Thu, 30 Dec 2010 12:03:14 -0500
Post by David Nolen
http://groups.google.com/group/qilang/browse_thread/thread/e4a2f534fad5032a
"I contend that this kind of problem cannot be solved (efficiently) in any
pure functional programming language. You may disagree"
Do you know if his C++ version available for examination?

thanks,
<mike
--
Mike Meyer <***@mired.org> http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to ***@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
Mark Engelberg
2011-01-01 11:53:04 UTC
Permalink
Post by David Nolen
http://groups.google.com/group/qilang/browse_thread/thread/e4a2f534fad5032a
"I contend that this kind of problem cannot be solved (efficiently) in any
pure functional programming language. You may disagree"
:D
David
Has anyone looked at this yet? I wrote a Clojure program to solve the
challenge, but I keep coming up with a count of 63,422 prime squares,
not 35,953.

I've posted a text file containing all the prime squares I found:
https://docs.google.com/leaf?id=0B0JrHNwD7hNSZTBmMzg5ZGEtZWZmZC00ZWI3LTk4MWItMjU2MDljMDBjYjNm&hl=en

I'd love to have another set of eyes on this. If you find the
challenge interesting, but not enough to want to code the whole solver
from scratch, maybe you could write a verifier to check and make sure
that each of my prime squares satisfies the constraints of the problem
and is unique with respect to isomorphism. I've verified it myself,
but maybe there's some subtlety I'm missing.

If 63422 is correct and I can get independent confirmation, it would
be fun to go back to the author of the challenge and say "Your C++
solution may be fast, but in a functional programming language, at
least we get the right answer :) "

Thanks.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to ***@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
Michael Wood
2011-01-01 15:53:54 UTC
Permalink
Post by David Nolen
http://groups.google.com/group/qilang/browse_thread/thread/e4a2f534fad5032a
"I contend that this kind of problem cannot be solved (efficiently) in any
pure functional programming language. You may disagree"
:D
David
Has anyone looked at this yet?  I wrote a Clojure program to solve the
challenge, but I keep coming up with a count of 63,422 prime squares,
not 35,953.
https://docs.google.com/leaf?id=0B0JrHNwD7hNSZTBmMzg5ZGEtZWZmZC00ZWI3LTk4MWItMjU2MDljMDBjYjNm&hl=en
I'd love to have another set of eyes on this.  If you find the
challenge interesting, but not enough to want to code the whole solver
from scratch, maybe you could write a verifier to check and make sure
that each of my prime squares satisfies the constraints of the problem
As far as I can see each of your squares do indeed satisfy the constraints.
and is unique with respect to isomorphism.  I've verified it myself,
but maybe there's some subtlety I'm missing.
I'm not sure how best to test that they are unique wrt. isomorphism.
If 63422 is correct and I can get independent confirmation, it would
be fun to go back to the author of the challenge and say "Your C++
solution may be fast, but in a functional programming language, at
least we get the right answer :) "
:)
--
Michael Wood <***@gmail.com>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to ***@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
Ken Wesson
2011-01-01 19:49:44 UTC
Permalink
Post by Michael Wood
I'm not sure how best to test that they are unique wrt. isomorphism.
(=
(* 8 (count squares-seq))
(count (distinct (flatten (map generate-isomorphs squares-seq))))),

of course. :)
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to ***@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
Matjaz Gregoric
2011-01-01 21:20:46 UTC
Permalink
According to my tests your squares both satisfy the conditions and are
isomorphically unique.
- Matjaz
Post by David Nolen
http://groups.google.com/group/qilang/browse_thread/thread/e4a2f534fad5032a
Post by David Nolen
"I contend that this kind of problem cannot be solved (efficiently) in
any
Post by David Nolen
pure functional programming language. You may disagree"
:D
David
Has anyone looked at this yet? I wrote a Clojure program to solve the
challenge, but I keep coming up with a count of 63,422 prime squares,
not 35,953.
https://docs.google.com/leaf?id=0B0JrHNwD7hNSZTBmMzg5ZGEtZWZmZC00ZWI3LTk4MWItMjU2MDljMDBjYjNm&hl=en
I'd love to have another set of eyes on this. If you find the
challenge interesting, but not enough to want to code the whole solver
from scratch, maybe you could write a verifier to check and make sure
that each of my prime squares satisfies the constraints of the problem
and is unique with respect to isomorphism. I've verified it myself,
but maybe there's some subtlety I'm missing.
If 63422 is correct and I can get independent confirmation, it would
be fun to go back to the author of the challenge and say "Your C++
solution may be fast, but in a functional programming language, at
least we get the right answer :) "
Thanks.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to ***@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
Mark Engelberg
2011-01-01 21:25:03 UTC
Permalink
Thanks everyone! I'll go post my findings to the Qilang google group.
I'll try to moderate the smugness I'm feeling right now :)
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to ***@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
Continue reading on narkive:
Loading...