September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,18 @@
aliquot(x) =
{
my (L = List(x), M = Map(Mat([x,1])), k, m = "non-term.", n = x);
for (i = 2, 16, n = vecsum(divisors(n)) - n;
if (n > 2^47, break,
n == 0, m = "terminates"; break,
mapisdefined(M, n, &k),
m = if (k == 1,
if (i == 2, "perfect",
i == 3, "amicable",
i > 3, concat("sociable-",i-1)),
k < i-1, concat("cyclic-",i-k),
"aspiring"); break,
mapput(M, n, i); listput(L, n));
);
printf("%16d: %10s, %s\n", x, m, Vec(L));
}