SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Pastimes : Where the GIT's are going -- Ignore unavailable to you. Want to Upgrade?


To: kumar who wrote (136343)3/2/2007 8:49:24 PM
From: Augustus Gloop  Read Replies (2) | Respond to of 225578
 
Many algorithms have been devised for determining the prime factors of a given number (a process called prime factorization). They vary quite a bit in sophistication and complexity. It is very difficult to build a general-purpose algorithm for this computationally "hard" problem, so any additional information that is known about the number in question or its factors can often be used to save a large amount of time.

The simplest method of finding factors is so-called "direct search factorization" (a.k.a. trial division). In this method, all possible factors are systematically tested using trial division to see if they actually divide the given number. It is practical only for very small numbers.



To: kumar who wrote (136343)3/3/2007 1:38:17 AM
From: Lazarus_Long  Read Replies (3) | Respond to of 225578
 
1. Gloop knows what a prime is????? WOW!

2. Take the square root of the number.
If the square root is an integer, then clearly then original number isn't.
If the square root isn't an integer, then truncate it and divide by that number.
Proceed to decrement that number by 1. Each time you hit a prime, divide the original number by it. If the quotient is an integer, the original number isn't prime. If you reach 1 and haven't determined the number is not prime, it is.

3. As Gloop said, there are also other ways. I believe the above method is called 'Erasthothenes' Sieve'. It was known to the ancient Greeks.

4. Number theorists are crazy. It may be because they have to deal with primes.