Problem 153
Posted: Sun Dec 07, 2008 11:44 am
Hello,
I have an issue regarding problem 153, I have made a script (in PHP) that works out all [complex] divisors of the real integer. Then it adds them up. And I can get 35 for n<5 in under a second. But when I try and run it for n<108 (I know the 1 minute rule, but I was ignoring that for now) and it ran over night and ended up on about n=60000. I gave up as this would take forever (as that is only 0.006% of the way through).
I had previously written some functions to deal with complex numbers (such as add, subtract, multiply, divide). And after dividing Array(5,0) [meaning: Re(5), Im(0) or 5] by Array(1,2) [meaning: Re(1), Im(2) or 1+2i] I get the desired result of Array(1,-2) [or 1-2i]. Now I wrote a function to find the complex divisors. For 5, the results are as follows (in no particular order):
Please can anyone give me any pointers?
Thanks, Rowan.
I have an issue regarding problem 153, I have made a script (in PHP) that works out all [complex] divisors of the real integer. Then it adds them up. And I can get 35 for n<5 in under a second. But when I try and run it for n<108 (I know the 1 minute rule, but I was ignoring that for now) and it ran over night and ended up on about n=60000. I gave up as this would take forever (as that is only 0.006% of the way through).
I had previously written some functions to deal with complex numbers (such as add, subtract, multiply, divide). And after dividing Array(5,0) [meaning: Re(5), Im(0) or 5] by Array(1,2) [meaning: Re(1), Im(2) or 1+2i] I get the desired result of Array(1,-2) [or 1-2i]. Now I wrote a function to find the complex divisors. For 5, the results are as follows (in no particular order):
This shows my script is working fine. It even works on much larger numbers too. It is just extremely slow.1-2i, 1, 1+2i, 2-i, 2+i, 5
Please can anyone give me any pointers?
Thanks, Rowan.