Skip to content

Instantly share code, notes, and snippets.

@aaronryank
Last active December 21, 2017 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronryank/56315c18b0592d85bbaf519cf49a0a0f to your computer and use it in GitHub Desktop.
Save aaronryank/56315c18b0592d85bbaf519cf49a0a0f to your computer and use it in GitHub Desktop.
Downloads all OEIS sequence lists and formats them into C arrays
#!/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