Perhaps you can use some variation of hf^:n 1x where 
   hf=: ~.@(/:~)@,@(1 2 3 5 */ ])



----- Original Message -----
From: Aai <[email protected]>
Date: Tuesday, January 5, 2010 9:19
Subject: [Jprogramming] Rosetta code: hamming numbers
To: Programming forum <[email protected]>

> J-ers and RC-ers,
> 
> I entered a solution for this task:
> http://rosettacode.org/wiki/Hamming_numbers .
> 
> hamming =: {. (/:~...@~.@] , 2 3 5 * {)/ @ (1x ,~ i...@-)
> 
> 
> However the problem is (which I didn't realize while entering my
> solution) producing the millionth hamming number. So if anyone 
> has a
> better idea on this, go ahead. Of course it's also a challenge 
> to come
> up with a very J-ish solution for this problem.
> 
> R.E.Boss perhaps? I used your solution HN00 and it produced the answer
> in ca. 47 sec on my computer.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to