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



The following seems to work OK--don't know what you mean by big, but you can set max to anything you want--can also set the lower limit on A to whatever you want. This is TrueBasic, but simple enough to convert to just about any computer language you want.

let max = 100
for A = 3 to max
let flag = 0
for B = 2 to A-1
if remainder (A,B) = 0 then
let flag = 1
exit for
end if
next B
if flag = 0 then print A
next A
end


----- Original Message ----- From: <rcarabaj@copelnet.com.ar>
To: <phys-l@carnot.physics.buffalo.edu>
Sent: Monday, November 06, 2006 2:16 PM
Subject: [Phys-l] Search for Prime Numbers Generation Program




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
_______________________________________________
Forum for Physics Educators
Phys-l@carnot.physics.buffalo.edu
https://carnot.physics.buffalo.edu/mailman/listinfo/phys-l