Created
August 23, 2015 23:17
-
-
Save flatcap/83fb223b8a18b08d0a04 to your computer and use it in GitHub Desktop.
Sunday Times Teaser 2761 (2015-08-23)
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
cards numbered 1-9 | |
laid out in ascending order | |
cards redealt, no card in original place | |
last 6 digits form the square of the first three digits |
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 | |
for i in {316..999}; do | |
echo $i$((i*i)) | |
done \ | |
| grep -v "\(.\).*\1" \ | |
| grep -v -e "^1" -e "^.2" -e "^..3" -e "^...4" -e "^....5" -e "^.....6" -e "^......7" -e "^.......8" -e "^........9" \ | |
| cut -b-3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment