Right, have a look at R Miller's solution.
No particular target. Just curious how fast a series of zumkeller
numbers could be generated. I was confused/disappointed by the result of
my translation of the Haskell function. Try to generate all zumkeller
numbers up to and inclusive 1e5. :-)
Hallo Andrew Nikitin, je schreef op 28-01-10 19:25:
>
>> From: Aai
>>
>> sigma(n) is just the sum of the divisors +/divs
>>
>> This was my first approach of sigmaTest:
>>
>> sigmtest=: 4 : 0
>> if. 0=x do. 1 return. end.
>> if. 0=#y do. 0 return. end.
>> if. x < {.y do. x sigmtest }.y
>> else. ((x-{.y) sigmtest }.y ) +. x sigmtest }.y end.
>> )
>>
>> This 'exact' translation makes it probably much slower.
>>
>>
>
> If you want, you can eliminate most of double recursion by using short scheme
> for +.
> Something along the lines of
> sigmtest=: 4 : 0
> if. 0=x do. 1
> elseif. 0=#y do. 0
> elseif. x < {.y do. x sigmtest }.y
> elseif. ((x-{.y) sigmtest }.y ) do. 1
> elseif. 1 do. x sigmtest }.y
> end.
> )
>
> What is the target number you want apply it to?
>
> _________________________________________________________________
> Hotmail: Trusted email with powerful SPAM protection.
> http://clk.atdmt.com/GBL/go/196390707/direct/01/
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
Met vriendelijke groet,
=@@i
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm