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,25 @@
go =>
println(happy_len(8)).
happy(N) =>
S = [N],
Happy = 1,
while (Happy == 1, N > 1)
N := sum([to_integer(I)**2 : I in N.to_string()]),
if member(N,S) then
Happy := 0
else
S := S ++ [N]
end
end,
Happy == 1.
happy_len(Limit) = S =>
S = [],
N = 1,
while (S.length < Limit)
if happy(N) then
S := S ++ [N]
end,
N := N + 1
end.