I spent a 1/2 hour to find a line by Stephen Kochan of Bell Labs ,
Programming in C 1988 Hayden Books, "One method for generating prime
numbers
involves an approach which uses the notion that a number is prime if it is
not evenly divisible by any other prime number. This stems from the fact
that any non-prime integer can be expressed as a multiple of prime
factors.
(For example 20, has the prime factors 2, 2, and 5). The program
algorithm
can test if a given integer is a prime by determining if it is evenly
divisible by any other previously generated prime. The term used
"previously generated" suggests that a recursive function is useful.
As a further optimization of the prime number generator program, it can be
demonstrated that any non-prime integer n, must have as one of its factors
an integer that is less then or equal to the square root of n.
So it is only necessary to determine if a given integer is prime by
testing
it for even divisibility against all prime factors up to the square root
of
the integer.
(but all those are infested by prime factors). So those primes can be
generated by using prime factors. It was not quite as straight forward as
you all believed. I ultimately could show what coincidence there was
between prime factors of the eventually generated primes. (what a nail
biter that was)>
"Richard Heathfield" <rjh@[EMAIL PROTECTED]
> wrote in message
news:3tadnbYxX94v3XbaRVnyvQA@[EMAIL PROTECTED]
> Captain Tony Valare said:
>
> > With recursion being a main control structure, as the author
suggests,
> > somewhere I missed the boat. I've never used recursion except once in
a
> > prime number analysis algorithm from a programming book. It said that
> > epime numbers were a combination of prime factors (which makes sense),
>
> No, it makes no sense at all. Primes /are/ prime factors. They are not
> combinations of anything. That is practically the definition of primes!
>
> Exercise: here are the first ten primes: 2, 3, 5, 7, 11, 13, 17, 19, 23,
> 29. List their prime factors.
>
> --
> Richard Heathfield <http://www.cpax.org.uk>
> Email: -http://www.
+rjh@[EMAIL PROTECTED]
> Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
> "Usenet is a strange place" - dmr 29 July 1999


|