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,30 @@
$ include "seed7_05.s7i";
include "bigint.s7i";
const func bigInteger: digitalRoot (in var bigInteger: num, in bigInteger: base, inout bigInteger: persistence) is func
result
var bigInteger: sum is 0_;
begin
persistence := 0_;
while num >= base do
sum := 0_;
while num > 0_ do
sum +:= num rem base;
num := num div base;
end while;
num := sum;
incr(persistence);
end while;
end func;
const proc: main is func
local
var bigInteger: num is 0_;
var bigInteger: root is 0_;
var bigInteger: persistence is 0_;
begin
for num range [] (627615_, 39390_, 588225_, 393900588225_) do
root := digitalRoot(num, 10_, persistence);
writeln(num <& " has additive persistence " <& persistence <& " and digital root of " <& root);
end for;
end func;