Data update

This commit is contained in:
Ingy döt Net 2025-06-11 20:16:52 -04:00
parent 72eb4943cb
commit 4d5544505c
2347 changed files with 62432 additions and 16731 deletions

View file

@ -0,0 +1,23 @@
uses school;
function totient(n: int64) := (1..n).Select(k -> (if gcd(n, k) = 1 then 1 else 0)).Sum;
function perfect(): sequence of integer;
begin
var n := 1;
repeat
var tot := n;
var sum := 0;
while tot <> 1 do
begin
tot := totient(tot);
sum += tot;
end;
if sum = n then yield n;
n += 2;
until false;
end;
begin
perfect.Take(20).Println;
end.