Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Happy-numbers/Zkl/happy-numbers-1.zkl
Normal file
9
Task/Happy-numbers/Zkl/happy-numbers-1.zkl
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
fcn happyNumbers{ // continously spew happy numbers
|
||||
foreach N in ([1..]){
|
||||
n:=N; while(1){
|
||||
n=n.split().reduce(fcn(p,n){ p + n*n },0);
|
||||
if(n==1) { vm.yield(N); break; }
|
||||
if(n==4) break; // unhappy cycle
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Task/Happy-numbers/Zkl/happy-numbers-2.zkl
Normal file
2
Task/Happy-numbers/Zkl/happy-numbers-2.zkl
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
h:=Utils.Generator(happyNumbers);
|
||||
h.walk(8).println();
|
||||
1
Task/Happy-numbers/Zkl/happy-numbers-3.zkl
Normal file
1
Task/Happy-numbers/Zkl/happy-numbers-3.zkl
Normal file
|
|
@ -0,0 +1 @@
|
|||
Utils.Generator(happyNumbers).drop(0d1_000_000-1).next().println();
|
||||
Loading…
Add table
Add a link
Reference in a new issue