Created
June 6, 2012 11:25
-
-
Save anonymous/2881357 to your computer and use it in GitHub Desktop.
Solution for Euler numbers
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
#!/bin/bash | |
################################################################################ | |
# Copyright (c) 2011, 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 [ ! -f eulers ]; then | |
wget -q -O eulers http://oeis.org/A028296/b028296.txt | |
fi | |
if [ $(( $1 % 2 )) == 1 ]; then | |
echo 0 | |
exit 0 | |
fi | |
grep "^$(($1 / 2)) " eulers | awk '{print $2}' | |
if [ $? -ne 0 ]; then | |
echo "For additional results you will need to hire me!" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment