Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: [Phys-l] Search for Prime Numbers Generation Program



Hello Brian:

Thanks, thanks very much for your large, meticulous and extremely useful
response. Yes, I write from Argentina, I have found this list a serious
source of abundant information for our delicate teaching specialty.
Roberto

-----Mensaje original-----
De: phys-l-bounces@carnot.physics.buffalo.edu
[mailto:phys-l-bounces@carnot.physics.buffalo.edu] En nombre de Brian
Whatcott
Enviado el: viernes, 10 de noviembre de 2006 00:16
Para: Forum for Physics Educators
Asunto: Re: [Phys-l] Search for Prime Numbers Generation Program

At 01:16 PM 11/6/2006, Roberto, you wrote:

Hello:

I apologize if my problem could be a little out of topic, but I am
dealing with prime number generation. Does somebody know a program to
generate very large prime numbers that can be shown to the students?
(Perhaps there can be an open-code project).
Thanks very much.

My best regards.

Roberto


Hi Roberto,
I see you are posting from distant parts - is it Argentina?

I noticed that the responses to your question were a little thin
which reminded me -
it's been years ago now since I was suggesting to the readers
of this list how helpful it is to use a search engine.
Not just years ago - but last decade, last century - some
previous millennium in fact - or so it seems.

One might once have tried Dogpile, or some other agglomerator
of web hits - but Google has long established a senior niche in the
search field.

It is also true that a certain proportion of contributors here are
grumpy old men - some retired even - though it is more sad to see
faithful contributors detaching themselves when retired. Which is to
say, the question may not have seemed exciting to everyone.

Anyway, to a young mind, a prime number generator can be a fulfilling
achievement. When IBM reps were casting round for ideas on making
a home based computer in the seventies, I for one advocated the
incorporation of Basic. That would be a way of writing some code
to list primes.


Still, enough reminiscing: a young person, armed only with the knowledge
that a number is called prime that cannot be divided by any whole
number smaller than itself other than one, may start with an exhaustive
division of each ascending number in turn.

She might then easily deduce that only odd numbers should be candidates
for primeness testing, for even numbers are divisible by two.

A next step in sophistication might be in realizing that it is not
necessary to divide by all the numbers less than the candidate, nor
even by all the odd numbers and two.

To get to this conclusion, one sees that a candidate may fail by
dividing by
some factor. And if there is some biggish factor, it will need
to be multiplied
by some smaller factor in order to make a candidate number fail.

In other words, there is a factor of maximal size which can possibly be
multiplied by another factor of similar size to reach the size of the
number
under test.
And of course, that factor of max size is the next whole number greater
than the root of the test candidate.
Then one may save each prime in an array, and divide only by these, but
that too is an exhaustive method, which does not allow one to start with
an arbitrarily large candidate.

These are the elementary methods, and they are all quite unsuitable for
your desire of working out prime numbers of many digits.

You will recall that the largest prime presently known has something
less than ten million digits - in fact, there is an appreciable prize
($100,000) for setting out the next prime of ten million digits or more,
if I recall.

But when I last did a Google search for
prime number generator,
besides the down loadable code, there were the web based calculators
- so let me find something for you now:

<http://alumnus.caltech.edu/~chamness/prime.html>

This one starts small, so there's not much danger of your winning
$100,000 with it.

<http://bach.dynet.com/primes/>
This has some sources, a list of the primes less than 1,000,000 and
means for finding primes of any length.

<http://javaboutique.internet.com/prime_numb/>
This is the java code (down loadable) to find a number of primes above
a given lower limit.

And fourth on the list of hits from Google is this Wikipedia entry,
which I commend to you.
<http://en.wikipedia.org/wiki/Prime_number>

(I expect you know already, but to get to the Google seach you go here:
<http://www.google.com/> for these first four hits, and the
succeeding 1.6 million hits in the same vein.

Respectfully

Brian Whatcott, Altus OK



_______________________________________________
Forum for Physics Educators
Phys-l@carnot.physics.buffalo.edu
https://carnot.physics.buffalo.edu/mailman/listinfo/phys-l


AVISO LEGAL:
Esta informacion es privada y confidencial y esta dirigida unicamente a su destinatario. Si usted no es el destinatario original de este mensaje y por este medio pudo acceder a dicha informacion por favor elimine el mensaje. La distribucion o copia de este mensaje esta estrictamente prohibida. Esta comunicacion es solo para propositos de informacion y no debe ser considerada como propuesta, aceptacion ni como una declaracion de voluntad oficial de REPSOL YPF S.A. y/o subsidiarias y/o afiliadas. La transmision de e-mails no garantiza que el correo electronico sea seguro o libre de error. Por consiguiente, no manifestamos que esta informacion sea completa o precisa. Toda informacion esta sujeta a alterarse sin previo aviso.

This information is private and confidential and intended for the recipient only. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and shall not be regarded neither as a proposal, acceptance nor as a statement of will or official statement from REPSOL YPF S.A. and/or subsidiaries and/or affiliates. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.