Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
29
Task/Chowla-numbers/Maple/chowla-numbers.maple
Normal file
29
Task/Chowla-numbers/Maple/chowla-numbers.maple
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
ChowlaFunction := n -> NumberTheory:-SumOfDivisors(n) - n - 1;
|
||||
|
||||
PrintChowla := proc(n::posint) local i;
|
||||
printf("Integer : Chowla Number\n");
|
||||
for i to n do
|
||||
printf("%d : %d\n", i, ChowlaFunction(i));
|
||||
end do;
|
||||
end proc:
|
||||
|
||||
countPrimes := n -> nops([ListTools[SearchAll](0, map(ChowlaFunction, [seq(1 .. n)]))]);
|
||||
|
||||
findPerfect := proc(n::posint) local to_check, found, k;
|
||||
to_check := map(ChowlaFunction, [seq(1 .. n)]);
|
||||
found := [];
|
||||
for k to n do
|
||||
if to_check(k) = k - 1 then
|
||||
found := [found, k];
|
||||
end if;
|
||||
end do;
|
||||
end proc:
|
||||
|
||||
PrintChowla(37);
|
||||
countPrimes(100);
|
||||
countPrimes(1000);
|
||||
countPrimes(10000);
|
||||
countPrimes(100000);
|
||||
countPrimes(1000000);
|
||||
countPrimes(10000000);
|
||||
findPerfect(35000000)
|
||||
Loading…
Add table
Add a link
Reference in a new issue