[futurebasic] [FB] prime number generation

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2000 : Group Archive : Group : All Groups

From: <michael_evans@...>
Date: 14 Mar 00 07:07:06 GMT
Hi...

I'm on the road and my daughter (grade 7) has e-mailed me asking to help 
with a prime number generation project.

I seem to recall a discussion about this on the list a while ago.

I would be grateful for any pointers...

What I would like to do is print a list of validated prime numbers and the 
longer the app runs the longer the list of validated prime numbers.

Presumably one starts with 3 (is 3 the lowest prime?). The brute force way 
is when the integer n (skipping even integers) is reached you successively 
divide by all the integers between 2 to n-1 in a loop...

Is 2^(n) - 1 sometimes/always a prime? 

In FB, what happens when you reach a larger number than can be contained 
by a positive long 4 byte integer?

Che

Cheers,


--------------------------------------------
Michael Evans
3301 Wood Valley Road, NW
Atlanta, GA 30327-1515
Phone: (404) 846-9386
Cell:  (404) 229-3930
Fax:   (404) 240-0330
Email: michael_evans@...
--------------------------------------------