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 @@
get "libhdr"
let sumdigitsq(n) =
n=0 -> 0, (n rem 10)*(n rem 10)+sumdigitsq(n/10)
let happy(n) = valof
$( let seen = vec 255
for i = 0 to 255 do i!seen := false
$( n!seen := true
n := sumdigitsq(n)
$) repeatuntil n!seen
resultis 1!seen
$)
let start() be
$( let n, i = 0, 0
while n < 8 do
$( if happy(i) do
$( n := n + 1
writef("%N ",i)
$)
i := i + 1
$)
wrch('*N')
$)