This is most likely about a Project Euler problem. A tough one, I don't know how to get the result under 60s time limit. To capture the Gaussian factors a+bi that divides an integer, I generated pairs of a and b (which is relatively prime to each other), and for each, I observed the a^2+b^2 denominator to see the smallest n which can divide a^2+b^2, ... something like that. I'm sure you already note that if a+bi is a factor, then a-bi is also a factor, and similiarly when a != b, b-ai and b+ai are also Gaussian factors.
My solution is very ugly but it does solve the problem in a little bit over 60 seconds. I'm sure there exists more elegant solution for this. Best, -Lego On 6/22/07, mukesh tiwari <[EMAIL PROTECTED]> wrote: > > > hello everybody . > i want to know algorithm for finding gaussian factor of real > number . > like for 5 there are five gaussian factors > 1, 1+2i, 1-2i, 2+i, 2-i, 5 and there sum is 12 . so can any one help > me on this topic . i search lot on google but could not find any > anything . if u have any such kind of link so kindly send me . thnkx > in advance . > > > > > -- Fear of the LORD is the beginning of knowledge (Proverbs 1:7) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---
