Last active
December 21, 2017 01:47
-
-
Save aaronryank/56315c18b0592d85bbaf519cf49a0a0f to your computer and use it in GitHub Desktop.
Downloads all OEIS sequence lists and formats them into C arrays
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Downloads all OEIS sequence lists and formats them into C arrays | |
for i in `seq 1 296700`; do | |
printf -v s "A%.6d" $i | |
echo $s >/dev/stderr | |
echo -n "long long int $s[] = {" | |
wget -qO- https://oeis.org/$s/list | tr -d '\n' | sed 's/^.*<pre>/<pre>/' | cut -c 7- | cut -f1 -d"]" | tr -d '\n' | |
echo "};" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment