tripleh

32 Reputation

2 Badges

16 years, 166 days

MaplePrimes Activity


These are answers submitted by tripleh

I guess my Maple coding is a litte off. I've never used the select command, I'm assuming that's where the quickness came in. I just did a for loop from 1 to 10000 and then ran pretty much the same processes you guys showed here.

I'll add that to my list of things to practice with.

 

Alec, a good exaple is problem 55. http://projecteuler.net/index.php?section=problems&id=55

It requires reversing the digits of a number, adding the reverse to the number, and seeing if the result is a palindrome. If not, you repeat the process until you get a palindrome. If you don't get one in 50 iterations, then it's a "Lycrel" number. Here the conversion to strings, back to numbers, and back to strings really eats up the time. The process I wrote did produce the correct answer, but it took 25 minutes to do so, even with a number of mathematical optimizations in the search areas.
 

Fortunately, I figured out how to code it in J and the answer was spit out immediately.

Page 1 of 1