Andrea Ambu wrote:

> I wasn't able to find a good way to do it, i tried:
>    z=:p:i.5
>    z*/z
>  4  6 10 14  22
>  6  9 15 21  33
> 10 15 25 35  55
> 14 21 35 49  77
> 22 33 55 77 121
>
> what I'd need from this matrix is an array containing the elements on
> its high (or low) triangle, diagonal included, as the rest are
> duplicated items. Any good way to do this?

Raul suggested a couple of ways to do this.  Unfortunately, it will not
solve the original problem, since you need too big an array.  As a very
mild spoiler , I suggest fixing a prime and counting the number of
semiprimes in which it participates. The solution then comes down to 3 or
4 lines in J.

Best wishes,

John


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

Reply via email to