It took me more time than expected to produce the sequence of numbers in J:

(from Seqfan Mailing list - http://list.seqfan.eu/)
> Beginning with a two-digit square, successively replace each digit 
> with its square, then repeat.
>
> For example,
>                                   9
>                                  81
>                                 641
>                               36161
>                             9361361
>                          8193619361
>                     641819361819361
>             36161641819361641819361
> 93613613616164181936136161641819361

   ((]#.~ 10x^10>:@<.@^.]) *:@(10&#.^:_1))^:(i.10)9
9 81 641 36161 9361361 8193619361 641819361819361 36161641819361641819361 
93613613616164181936136161641819361 
8193619361936136136161641819361936136136161641819361

Curious about other, more elegant solutions, since my J is getting rusty.


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

Reply via email to