On May 1, 2007, at 7:53 AM, Roger Hui wrote:
But the main difficulty with problem 152 (and most
other Project Euler problems) is not with the
programming language, but with the mathematics
involved in the problem.
For many of the problems, I disagree. For the language I was using
(Revolution) I had to code:
-- a prime sieve -- two, in fact: the second one was open-ended,
keeping track of all the primes it was sieving by as it went and
discarding previous results. This allowed it to look for primes out
to several billion without running out of memory.
-- a bignum library, with +-*/^ and sqrt
-- a pri
-- a bignum power function
-- a factorization routine
-- a phi function
...and several others, but you get the idea: repeatedly I was coding
things that come for free in J. I learned a lot writing those
routines, but it grows tiresome. You could argue that my point is the
weakness of Revolution, and for the purpose of Project Euler you'd be
right. But even so, the solutions I see people post in C, VB, Java,
and many other languages show the same weaknesses. J is remarkably
strong for this sort of thing. Thanks!
That said, of course there are problems on PE that no language other
than "brain" has a ready-made solution for. Unfortunately for me, I
think my copy of "brain" is a few upgrades short of current ;-) I'm
trying to upgrade now.
regards,
Geoff
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm