Skip to content

Instantly share code, notes, and snippets.

@stephenc
Forked from anonymous/euler.sh
Created June 6, 2012 11:26
Show Gist options
  • Save stephenc/2881359 to your computer and use it in GitHub Desktop.
Save stephenc/2881359 to your computer and use it in GitHub Desktop.
Solution for Euler numbers
#!/bin/bash
################################################################################
# Copyright (c) 2012, by Michael Neale. All rights reserved.
#
# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MICHAEL NEALE
#
# The copyright notice above does not evidence any
# actual or intended publication of such source code.
################################################################################
if [ $1 -gt 2000 ]; then
echo "For additional results you will need to hire me!"
exit
fi
curl -s -X POST -d "number=$1&submit=Compute" http://www.numberempire.com/eulernumbers.php | sed -n -e "s:<br/>::g;s:<a href='.*'>::g;s:</a>::g;/Euler number/,/td/p" | grep -v "<"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment