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,10 @@
proc is_happy(n);
s := [n];
while n > 1 loop
if (n := +/[val(i)**2: i in str(n)]) in s then
return false;
end if;
s with:= n;
end while;
return true;
end proc;

View file

@ -0,0 +1,8 @@
happy := [];
n := 1;
until #happy = 8 loop
if is_happy(n) then happy with:= n; end if;
n +:= 1;
end loop;
print(happy);

View file

@ -0,0 +1 @@
print([n : n in [1..100] | is_happy(n)](1..8));