mixster
2008-03-05 14:38:17
Don't we all hate it when we get asked for that prime 11 digit number and we just can't think of one off the top of our heads? Well hate no more, with the prime 11 digit number checker! Has full Int64 support (after a lot of me getting pissed off) so you can get just about any prime number if you wish to change the script! Furthermore, if you run it for long enough, you actually get a full list of all the 11 digit prime numbers! Now, without further rambling, I present to you, the 11 digit prime number checker!
Version 3P(lugin) is now available and uses the attatched delphi plugin to speed up the checking greatly.
You can change the boolean in CheckPrime to show extra debug text (written from the dll and consists of what number it is currently dividing and the result of the number divided by i and the number rounded), though it will seriously clog up the debug box. Lastly, I will be improving the 3P version to make it look nice etc. but in the mean time, the script works well.
~ R.I.P mr.kleans signature ~
Version 3P(lugin) is now available and uses the attatched delphi plugin to speed up the checking greatly.
program ElevenDigitPrimeNumberChecker;
var
i,d: Int64;
aPNum: array of Int64;
li,li2,ii: Integer;
begin
ClearDebug;
ClearReport;
ChangeReportWidth(200);
li:=0;
li2:=7;
i:= 10000000001;
repeat
if(CheckPrime(i,d,False))then
begin
SetArrayLength(aPNum,GetArrayLength(aPNum)+1);
aPNum[GetArrayLength(aPNum)-1]:= i;
AddToReport(Int64ToStr(i)+' is prime');
end
else
begin
Writeln(Int64ToStr(i)+' is not prime - divisable by '+Int64ToStr(d));
end;
i:=i+2;
until(i>=100000000000);
i:= 0;
ClearDebug;
ClearReport;
repeat
Writeln(Int64ToStr(aPNum[ii])+' is prime, yay!');
Inc(ii);
until(ii>=GetArrayLength(aPNum));
end.V2 (plugin) got released quickly as I added Sqrt compatibility making it run much much faster on actual prime numbers.You can change the boolean in CheckPrime to show extra debug text (written from the dll and consists of what number it is currently dividing and the result of the number divided by i and the number rounded), though it will seriously clog up the debug box. Lastly, I will be improving the 3P version to make it look nice etc. but in the mean time, the script works well.
~ R.I.P mr.kleans signature ~