Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Van-Eck-sequence/Zkl/van-eck-sequence-1.zkl
Normal file
8
Task/Van-Eck-sequence/Zkl/van-eck-sequence-1.zkl
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fcn vanEck(startAt=0){ // --> iterator
|
||||
(startAt).walker(*).tweak(fcn(n,seen,rprev){
|
||||
prev,t := rprev.value, n - seen.find(prev,n);
|
||||
seen[prev] = n;
|
||||
rprev.set(t);
|
||||
t
|
||||
}.fp1(Dictionary(),Ref(startAt))).push(startAt)
|
||||
}
|
||||
7
Task/Van-Eck-sequence/Zkl/van-eck-sequence-2.zkl
Normal file
7
Task/Van-Eck-sequence/Zkl/van-eck-sequence-2.zkl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
foreach n in (9){
|
||||
ve:=vanEck(n);
|
||||
println("The first ten terms of the Van Eck (%d) sequence are:".fmt(n));
|
||||
println("\t",ve.walk(10).concat(","));
|
||||
println(" Terms 991 to 1000 of the sequence are:");
|
||||
println("\t",ve.drop(990-10).walk(10).concat(","));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue