A few more using more @ as requested.
10 {. (#~ (-: |.)@":"0@(*: + 9&*)) >:i.12000
2 12 44 137 157 167 248 258 1639 1664
10 {. (#~ (-: |.)@":"0@<.@:(0 9 1&p.)) >:i.12000
2 12 44 137 157 167 248 258 1639 1664
10 {. ({~ [: I. (= |.&.(10&#.^:_1))"0@(* 9&+)) >:i.12000
2 12 44 137 157 167 248 258 1639 1664
> -----Original Message-----
> From: [email protected] [mailto:programming-
> [email protected]] On Behalf Of Sherlock, Ric
> Sent: Tuesday, 25 August 2009 18:41
> To: Programming forum
> Subject: Re: [Jprogramming] Finding n where n(n+9) is an palindrome
>
> 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
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm