On Mon, Aug 24, 2009 at 3:50 AM, Bo Jacoby<[email protected]> wrote:
> Impressive. But, as often with J, not immediately comprehensible.
...
>> Fra: Roger Hui <[email protected]>
>>   j #~  (j e. <:p: j) * (j e. >:*:j) * (2...@q: j) * 2...@q:@(|.&.":"0) j=: 
>> 1+i.1e6
>> 226 47962 95482 103042 140626 194482 370882

j=: 1+i.1e6
numbers one through one million

|.&.":"0
those numbers with their digits reversed

2 = #...@q:
1 if they are the product of 2 primes, 0 if not

[note that Roger's code requires that both the
number and the reversed digits number be
the product of 2 primes.]

(j e. >:*:j)
1 if they are one plus a square number, 0 if not

(j e. <:p: j)
1 if they are one less than than a prime.

Roger's code looks for numbers which have all of
these qualities.

And... I find I can not comprehend the english
I wrote any faster than I could comprehend
his original code.

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

Reply via email to