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,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)
}

View 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(","));
}