Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,39 +0,0 @@
|
|||
--
|
||||
-- Determine primality using Wilon's theorem.
|
||||
-- Uses the approach from Algol W
|
||||
-- allowing large primes without the use of big numbers.
|
||||
--
|
||||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure Main is
|
||||
type u_64 is mod 2**64;
|
||||
package u_64_io is new modular_io (u_64);
|
||||
use u_64_io;
|
||||
|
||||
function Is_Prime (n : u_64) return Boolean is
|
||||
fact_Mod_n : u_64 := 1;
|
||||
begin
|
||||
if n < 2 then
|
||||
return False;
|
||||
end if;
|
||||
for i in 2 .. n - 1 loop
|
||||
fact_Mod_n := (fact_Mod_n * i) rem n;
|
||||
end loop;
|
||||
return fact_Mod_n = n - 1;
|
||||
end Is_Prime;
|
||||
|
||||
num : u_64 := 1;
|
||||
type cols is mod 12;
|
||||
count : cols := 0;
|
||||
begin
|
||||
while num < 500 loop
|
||||
if Is_Prime (num) then
|
||||
if count = 0 then
|
||||
New_Line;
|
||||
end if;
|
||||
Put (Item => num, Width => 6);
|
||||
count := count + 1;
|
||||
end if;
|
||||
num := num + 1;
|
||||
end loop;
|
||||
end Main;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
-- 28 Jul 2025
|
||||
include Settings
|
||||
-- 24 Aug 2025
|
||||
include Setting
|
||||
numeric digits 10
|
||||
|
||||
say 'PRIMALITY BY WILSON''S THEOREM'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue