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,6 @@
# Generate the sylvester integers:
def sylvester:
foreach range(0; infinite) as $i ({prev: 1, product: 1};
.product *= .prev
| .prev = .product + 1;
.prev);

View file

@ -0,0 +1,3 @@
def lpad($len; $fill): tostring | ($len - length) as $l | ($fill * $l)[:$l] + .;
def lpad($len): lpad($len; " ");
def lpad: lpad(4);

View file

@ -0,0 +1,5 @@
[limit(10; sylvester)]
| "First 10 Sylvester numbers:",
(range(0;10) as $i | "\($i+1|lpad) => \(.[$i])"),
"",
"Sum of reciprocals of first 10 is approximately: \(map( 1/ .) | add)"