Thank you for the awnsers.

I'm having some trouble understanding the codes tough.... In Roger's code
what does the I. do? Here's how I read the code:

+/ I. ((-:|.)@#: *. (-:|.)@":)"0 i.1e6

from 1 to 1e6, check if the number is palyndrome in base 2 and in base 10.
I. the bolean list // don't understand this part
sum the elements

In Mike's code, there's a nice speed boost, but I can't understand the code
flow... How do you prevent from doing a test if the other test was false? I
beleive it has to do with the * primitive...

And if we wanted to do as Raul told and only test odd numbers, how do we go
from 1 to 999999 jumping 2 numbers? That would cut the code execution time
in half I beleive.

#######################

I tried going back to problem 1 and adapting your solutions to it, but
failed =(

   +/ 1e3 #~ ((3|"0)) +. (5|"0)) i. 1e3
   NB. how do I access the current number from inside the ( ) ?

Bruno
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to