10 {. (#~ [: (-: |.)@":"0 ] * +&9) >:i.12000
2 12 44 137 157 167 248 258 1639 1664

Or 

   (10 {. ] #~ [: (-: |.)@":"0 ] * +&9) >:i.12000
2 12 44 137 157 167 248 258 1639 1664

> From: Ian Gorse
> 
> For example:
> 258 is a value of n so that n(n+9) is a palindrome.
> 
> I set out to find the first 10 numbers that meet this criteria and I
> came up with this..
> 
>   10 {. n #~ ,(  ( ] = [: ". [: |. ": )  ] * +&9 ) "0 ( n =. >: i.12000
> )
> 2 12 44 137 157 167 248 258 1639 1664
> 
> As you can see, I have already found my answers but this is just an
> educational request.
> I am just looking for some alternative solutions so I can read and
> digest the different ways it can be done. Ideally with the use of the
> @ conjuction as
> I have recently been understanding the conjuction @ a lot more, as I
> find the 'flow' of reading the J expression more fluent.

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

Reply via email to