Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,44 @@
isStrong := proc(n::posint) local holder;
holder := false;
if isprime(n) and 1/2*prevprime(n) + 1/2*nextprime(n) < n then
holder := true;
end if;
return holder;
end proc:
isWeak := proc(n::posint) local holder;
holder := false;
if isprime(n) and n < 1/2*prevprime(n) + 1/2*nextprime(n) then
holder := true;
end if;
return holder;
end proc
findStrong := proc(n::posint) local count, list, k;
count := 0; list := [];
for k from 3 while count < n do
if isStrong(k) then count := count + 1;
list := [op(list), k];
end if;
end do;
return list;
end proc:
findWeak := proc(n::posint) local count, list, k;
count := 0;
list := [];
for k from 3 while count < n do
if isWeak(k) then
count := count + 1;
list := [op(list), k];
end if;
end do;
return list;
end proc:
findStrong(36)
findWeak(37)
countStrong(1000000)
countStrong(10000000)
countWeak(1000000)
countWeak(10000000)